Development

Continuing on from BDD Feature Files guidelines
Say I have 10 feature files testing user actions 1-10, 1-Fund transferring, 2-Display balance, 3-etc
feature files:
In ‘Fund transferring’, login, navigate to fund transfers, transfer test.
In ‘Display balance’, login, navigate to balanes, verify balances.
etc
What is the best way to structure these to have login as a pre-req so as not to need logging in each time?
In ‘login’, login successfully. If passed:

In ‘Fund transferring’, navigate to fund transfers, transfer test.

In ‘Display balance’, navigate to balanes, verify balances.

etc

I’m using StringUtils from the Apache commons library to check the # of matches of a sub-string within the source code of an HTML page.
I have converted the page source using the WebDriver command:
String pageSource = driver.getPageSource();

The code I’m using to find # of matches is:
int cloudfCount = StringUtils.countMatches(pageSource, “cloudfront”);
System.out.println(“There are ” + cloudfCount + ” instances of cloudf text found within the page source.”);

When I right-click within the page, view source, then Ctrl-F to find CloudFront, I get 2 matches. Which is what I’m expecting.
But when I use the above code in an automated Selenium script, I’m getting 5 results.
Any thoughts/ideas on where I’m going wrong?
Could it somehow be related to the fact, that the CloudFront text is part of 2 JavaScript tags within the page source?

The DistroWatch news feed is brought to you by TUXEDO COMPUTERS. This week in DistroWatch Weekly:
Review: Redox OS in 2024
News: AlmaLinux releases Raspberry Pi build, Canonical partners with DeepComputing to launch RISC-V laptop running Ubuntu, key new changes in systemd 256, Chromium OS to shift to Android foundation
Questions and answers: The BSDs, X11, and Wayland
Released last week: openSUSE….

The DistroWatch news feed is brought to you by TUXEDO COMPUTERS. postmarketOS is an Alpine-based Linux distribution for mobile devices. The project’s latest version is postmarketOS 24.06 which is based on Alpine Linux 3.20. “As always we target the most recent Alpine release. In case of v24.06 it is the excellent Alpine Linux 3.20. User Interfaces (UIs): GNOME Shell….