I want to select books which is ‘In-stock’. Each time number of ‘In-stock’ vary dynamically. Some time we have only 4 books “In-stock”. some other time more or less than 4 books ‘In-stock’.
Development
When I try to take a screenshot, I added a scroll so that it can take a significant screenshot and not only the header. Right now, the picture is still taken from the header/top of the page.
Am I doing something wrong?
Screenshot method :
public void ScreenShot() {
JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript(“scroll(0,450);”);
DateTimeFormatter dtf = DateTimeFormatter.ofPattern(“yyyy-MM-dd HH_mm_ss”);
LocalDateTime now = LocalDateTime.now();
String destDir = System.getProperty(“user.dir”) + “/” + “test-output/ScreenShots”;
String FileName = “SoftAssertScreenshot_” + dtf.format(now) + “.png”;
String DestFile = destDir + “/” + FileName;
File file = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);
File ScreenshotName = new File(DestFile);
try {
FileUtils.copyFile(file, ScreenshotName);
} catch (IOException e) {
e.printStackTrace();
}
Reporter.log(“</br><font color=’#73a9d0′>***************Screen Of the error****************</font>”);
Reporter.log(“</br><img id=’ErrorResult’ src='” + DestFile + “‘ style=’width:600px’/>”);
}
The Replicate Laravel package is a PHP client for the Replicate API, an API to run and fine-tune open-source AI…
The cybersecurity community is on edge after an unidentified threat actor operating under the username ‘UAE’, claimed responsibility for a…
A forensic analysis of a graph dataset containing transactions on the Bitcoin blockchain has revealed clusters associated with illicit activity…
Cybersecurity researchers have discovered a previously undocumented malware targeting Android devices that uses compromised WordPress sites as relays for its…
Post Content Source: Read MoreÂ
Artificial intelligence and machine learning are fields focused on creating algorithms to enable machines to understand data, make decisions, and…
The chrome browser version is Version 115.0.5790.171 and downloaded chrome driver version is 114
[![enter image description here][1]][1]
as driver version 115 is not available.
I’m using the x-path and checked the x-path is correct or not in developer tool under console section it is correct. Even tried absolute path given by Automation Tester but still getting as No such element is found
[![enter image description here][2]][2]
[![enter image description here][3]][3]
This x-path is getting due to chrome browser version is 115 and chrome driver version is 114 using due to unavailable.
Could someone please help me
[1]: https://i.stack.imgur.com/RnSVN.png
[2]: https://i.stack.imgur.com/ydrhs.png
[3]: https://i.stack.imgur.com/hXedl.png
Assumptions, imagine we are selling a software API:
a “system test” verifies that a system works by calling it’s public interface e.g. assert(init()==true) or assert(MY_PI > 2 && MY_PI <= 10)
a set of “unit tests” verifies the public interface of implementation details (assuming OOP: all public methods and fields) does what is expected
an “integration test” is something in between and is not really important for the question.
What I wonder is what is the term/s for more localized whitebox tests :
private methods(and if You cluster that with “unit”, what about lambdas?)
assert()*s peppered inside methods/functions.
* – referring to C++ asserts which compile to no operation in release code; not python asserts which are beautiful ifs
The authors behind the resurfaced ZLoader malware have added a feature that was originally present in the Zeus banking trojan that it’s based on, indicating that it’s being…
National Supply Chain Day, which was recently observed on April 29, serves as a dedicated day to recognize the critical…
There’s a natural human desire to avoid threatening scenarios. The irony, of course, is if you hope to attain any semblance…
Post Content Source: Read MoreÂ
A lot of new CSS features can help you optimize your code and reduce redundancy. Source: Read MoreÂ
Have you ever wondered why you visit the bank less or why we now order a product from our device…
Large language models (LLMs) are expanding in usage, posing new cybersecurity risks. These risks emerge from their core traits: heightened…
Free LLM Playgrounds and Their Comparative Analysis As the landscape of AI technology advances, the proliferation of free platforms to…
Neuro-Symbolic Artificial Intelligence (AI) represents an exciting frontier in the field. It merges the robustness of symbolic reasoning with the…
I created a sample Selenium Webdriver test using java and maven and pushed it out to my gitlab repository. Then I created a new pipeline to run the automated tests. This is my first time running a test on the pipeline so I followed some instructions online. The issue I’m having is that the test fails because of this error: (unknown error: DevToolsActivePort file doesn’t exist)
I saw some few questions regarding this too and tried to add those solutions but still getting that error. Used this link where I added those arguments.
WebDriverException: unknown error: DevToolsActivePort file doesn’t exist while trying to initiate Chrome Browser
Not sure what I need to do to fix this error or how to run the test as a non-root user which can maybe be a workaround.
This is my yml file for the pipeline
# calling the docker image where chrome, maven, jdk are available to run the tests
image: markhobson/maven-chrome:jdk-11
# building the maven
build:
stage: build
script:
– mvn compile
# running the tests
test:
stage: test
script:
– mvn clean test
BaseTest class
@BeforeSuite
public void beforeSuite() {
WebDriverManager.chromedriver().setup();
ChromeOptions options = new ChromeOptions();
String runTime = null;
try {
InputStream input = BaseTest.class.getClassLoader().getResourceAsStream(“runSetup.properties”);
Properties properties = new Properties();
properties.load(input);
runTime = properties.getProperty(“runTimeOnLocal”);
} catch (IOException e) {
e.printStackTrace();
}
// if it’s true, that means running locally on my machine and open the webrowser
// if it’s false, that means it’s running on gitlab headless
if(runTime.equalsIgnoreCase(“TRUE”)) {
options.addArguments(“start-maximized”);
options.addArguments(“enable-automation”);
options.addArguments(“–no-sandbox”);
options.addArguments(“–disable-infobars”);
options.addArguments(“–disable-dev-shm-usage”);
options.addArguments(“–disable-browser-side-navigation”);
options.addArguments(“–disable-gpu”);
}
else if(runTime.equalsIgnoreCase(“FALSE”)) {
options.addArguments(“–disable-dev-shm-usage”);
options.addArguments(“–no-sandbox”);
options.addArguments(“–disable-gpu”);
options.setHeadless(true);
}
driver.set(new ChromeDriver(options));
Log.info(“Opening web application”);
driver.get().get(“https://demo.opencart.com/”);
}
I also put the link to my repo as this is a sample for me to review selenium (need to switch to master branch)
SeleniumReview