Questions tagged [java]
Questions about testing applications written in Java or test automation written in Java, a popular programming language and runtime environment which allows Java programs to run unchanged on most hardware and software platforms.
1,451
questions
0
votes
1
answer
42
views
Maven Standard Directory Layout for UI Test Automation project on Java: what modules should be considered as main, and what as test?
Usually UI test automation framework is a separate code base, different from developers repository.
It is common to use Maven or Gradle as a build tool in test automation frameworks written on Java. ...
0
votes
1
answer
42
views
Best way to automate File contents verification using Selenium/Java?
In my application, there are lot of files that contain financial data and those are sent to different parties. So, I have to automate verification of content of all these files. Now, each file has a ...
0
votes
1
answer
35
views
What is the correct way to wait for database updates when testing the api?
I'm testing the api - after the request, I check that the values have appeared in the database.
A simple example is I'm throwing JSON
{
"field_1": "Value_1",
"...
0
votes
0
answers
44
views
How to run multiple Feature files parallelly in Cucumber with TestNG Runner?
I am facing one issue: I need to run 5 feature files that are totally independent of each other, Each feature files logs into a different site. I want 5 different ChromeDriver Browser sessions to open ...
0
votes
0
answers
29
views
What are the possible modifications I need to do to simulate real user traffic for a given web URL?
I was running my selenium script on a hosted cloud server to simulate and increase the real user count.
Unfortunately at the beginning of the day it shows a lot of user count at my web admin dashboard....
0
votes
0
answers
31
views
What does this err means?Cannot inject @Test annotated Method [verifyLoginWithCorrectCredential] with [class java.lang.String, class java.lang.String]
Im new with selenium automation. I was just trying to automate a basic login page and I got this error.
I ve created 3 pages which is as follows:
BaseClass:
import org.testng.annotations.BeforeMethod;...
0
votes
0
answers
21
views
Regarding Google Playstore Automation
I have this project where I have to automate the Play Store using Java and Appium.
Problem:
The problem I am facing is, that it seems like the buttons in the Play Store are changing their id's ...
0
votes
0
answers
19
views
How to get HTML code in <iframe> with "srcdoc" attribute by selenium Java?
I need to access the page elements that are in the iframe with the src Doc attribute and I'm not getting the full content.
Page code:
Java code with WebDriver:
This is turns out to get:
But I need ...
0
votes
2
answers
118
views
How to use java classes of one Selenium project into Another project in Eclipse?
I have around 10 Selenium/Java projects in Eclipse IDE and there is "utils" package and Automation framework classes that i manually copied to all projects and all those have different ...
0
votes
0
answers
50
views
How to keep "--disable-web-security" for some testcases and for others skip "--disable-web-security"
@BeforeMethod
public void setUpPlaywright(ITestResult testData) {
String[] chromiumArgs = {
"--disable-web-security",
"--no-sandbox",
"--ignore-...
0
votes
1
answer
51
views
Get code from email - java
I have an automation flow where there is a need retrieve a code from an email and input it into as a verification code.
As its a demo I could use any temp email and grab it but I am wondering now what ...
0
votes
1
answer
83
views
Test data management for automation api testing
Can you help me with some ideas on how to deal more efficent with test data used as precondition for automated api tests? I can’t use api calls for creating the data, so I would have to use sql ...
-1
votes
1
answer
439
views
import org.apache.commons.io.FileUtils [duplicate]
I have the same issue I can not access "import org.apache.commons.io.FileUtils;" I get the message "The package org.apache.commons.io is not accessible", Although I have added the ...
0
votes
1
answer
115
views
How to get all existing li-hidden-elements under ul tag using Selenium while loading JS?
I'm struggling with the following code using Selenium 3.141.59 and Java 11:
@Override
public void run() {
WebDriverManager.chromedriver().setup();
ChromeOptions options = new ChromeOptions();
...
0
votes
1
answer
82
views
How to unfreeze debug while getting hidden-li elements of DOM into the list using Selenium WebDriver?
I need to get a sheet of li elements on the site. The problem is that by clicking on "View page code" the block collapsed to ul in which the li elements are empty.
Suppose the <li> ...
0
votes
0
answers
630
views
Exception in thread "main" org.openqa.selenium.remote.NoSuchDriverException in eclipse
Facing the below error while running selenium java project in eclipse
Exception in thread "main" org.openqa.selenium.remote.NoSuchDriverException: chromedriver located at C:\Users\hp\...
0
votes
0
answers
144
views
How can I extract big image using Selenium & Java correctly?
I'm using the following code and struggling with snippet, provided below:
@Override
public void run() {
// List of all articles included in the collection
List<Article> ...
-1
votes
1
answer
101
views
How to extract list of arrivals correctly using Selenium?
Good evening, colleagues!
I need help to extract list of arrivals:
I have the following snippet of the code as below one:
...
WebElement newArrivals = driver.findElement(By.xpath(
("//*[...
-1
votes
1
answer
49
views
Microsoft Account SignIn button cannot be clickable (Java Selenium Excel)
This is my code
public void AccessLogin() throws IOException, InterruptedException {
WebElement oauth = driver.findElement(oAuth);
oauth.click();
driver.get("https://login....
0
votes
0
answers
31
views
how to sendkeys to an authentication popupon firefox 38.5.2
Hello all,
i'm trying to automate a webpage scenario with a pop up on firefox 38.5.2 using java. however i haver this error => Action error encountered result: false message: org.openqa.selenium....
0
votes
2
answers
105
views
How to handle this Particular date picker scenario where i want to traverse back in selenium
In this code i want to navigate to the year 2022 and select July and print that result in the console but the issue is that in the else if condition when checking when this particular condition is ...
-1
votes
1
answer
55
views
I am learning Page Model Object, i was trying to make this program work but i am getting the "NullPointerException" error everytime. can someone help
FrameWork code:
package FrameWorks;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support....
0
votes
0
answers
167
views
How to connect to a Anti-Detect browser (Incogniton) using selenium java
I want to connect to a browser session of this specific anti-detect browser called Incogniton.
It does support Selenium browser automation, but it only supports Python. I don't know anything about ...
0
votes
0
answers
720
views
How to set --disable-web-security in PlayWright - Java
Is there any possibility to pass "--disable-web-security" parameter when opening a new web page, as we do in selenium.
Edit:
I was able to get it done by below code
String[] ...
1
vote
1
answer
832
views
How to share data between steps in Cucumber feature file?
I am designing automation scripts using the REST APIs, RestAssured with Cucumber BDD framework. I have multiple APIs where one API's response is used as a parameter in another API.
Here is my feature ...
-1
votes
1
answer
121
views
Selenium - Page Object Model - Good way to identify page during a dynamic flow
My application has a possible flow to get all info from the user, where at max might consist of pages in the order A->B->C->D->E->F, each page asking for different info until we get to ...
-1
votes
1
answer
133
views
I am facing an issue on selenium java jenkins framework. Element working on Local maven project build but not working on Jenkins
And And I enter Auto Created Reseller in BA Reseller add button edit field
org.openqa.selenium.InvalidSelectorException: invalid selector: Unable to locate an element with the xpath expression None ...
0
votes
0
answers
342
views
How to get list of li elements using Selenium correctly?
I'm using Selenium in the following manner as below:
ChromeOptions options = new ChromeOptions();
/*options.addArguments("--headless");
options.addArguments("--...
0
votes
1
answer
283
views
selenium java modifications to the dom, how to reload the page to display modifications
0
I have a driver in java selenium :
driver.get(url);
I have made some changes to a WebElement with this method :
JavascriptExecutor jse = (JavascriptExecutor) driver;
jse.executeScript("...
0
votes
1
answer
1k
views
How to by pass authentication(microsoft authenticator) while login into the website through selenium script
After passing login id and password, user must add code from mobile app - microsoft authenticator.
I want to bypass this code pop-up as I'm generating regression suite and it's not feasible to add ...
0
votes
0
answers
70
views
The selector is not recognized by selenium java
I have the following HTML code for a button:
<div class="link" data-background-color="#fb00ff" style="background-color: rgb(251, 0, 255);">
<div data-replace-...
0
votes
1
answer
345
views
I get a timeout error after clicking a button (not a page load) in Selenium for Java
I get a timeout error after clicking a button (not a page load) in Selenium for Java. The button triggers a recalculation and causes the cursor to spin and be unavailable for the 5-6 minutes until the ...
0
votes
1
answer
151
views
Why does this Selenium script sometimes fail to detect that the element has become stale?
This is a helper method we use in many places in our Selenium Java tests. The intent is to click a button and then detect that the browser has navigated away from the page by detecting the staleness ...
0
votes
1
answer
171
views
How to capture the element using srcset attribute?
I'm trying to understand the difference between the data-srcset and srcset attributes.
I need to get a photo by the srcset attribute, but I can only get it using data-srcset.
I don’t really understand ...
0
votes
1
answer
270
views
"com.jacob.com.ComFailException: Can't co-create object" with java 11
Im working with SAP test automation with the JCOB DLL 1.18.64bit library.
My code was working fine when I run the test with Java 8.
But when I set the project settings to Java 11, I got below error.
...
0
votes
1
answer
28
views
Appium version issue
I am confused to see what Appium version is installed on my machine. If I look into Appium UI it shows Appium v1.22.3 but When I check from cmd it shows 2.0.0-beta.71. how do I know which one is ...
0
votes
0
answers
116
views
Calender is clicking on the next button getting element click intercept exception it just clicks once on the next button in the calender
Steps:
I am trying to click on the Calendar and select the Date from the Calendar and also select year and month but it just clicks once in the next button after opening the calendar and leads to ...
0
votes
1
answer
113
views
Unable to locate an element when "show user agent shadow DOM" is enabled
As for the image, I need to capture an element which is under show user agent shadow DOM.
I tried using //*[@id="placeholder"], but as for the image, its Zero matches.
By looking at some ...
-2
votes
2
answers
1k
views
What is a NullPointerException, and how do I fix it?
My test automation returns NullPointerException.
What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?
What methods/tools can be used to determine the cause so that ...
0
votes
0
answers
881
views
Java Cucumber - junit does not run any test
could you tell me why "mvn test" or "mvn verify" does not run any test ? Maybe any dependency is missing ?
package cucumber.Options;
import io.cucumber.junit.Cucumber;
import io....
0
votes
2
answers
7k
views
Java maven - IllegalArgumentException: Input must be set
I get the following errror when I use git bash command - however when I run the test in Intellij everything works fine and test starts. Could you help ?
mvn test -Dcucumber.filter.tags="@desktop&...
1
vote
1
answer
2k
views
Java Cucumber - pretty html reports net.masterthought - No JSON report file was found
I get the following error when I run the code
About to generate Cucumber report.
May 02, 2023 6:55:06 PM net.masterthought.cucumber.ReportBuilder generateErrorPage
WARNING: Unexpected error
net....
0
votes
1
answer
759
views
Java selenium - pretty cucumber reports not generated with screenshot
could you tell me how to generate pretty html reports with screenshot ? After I run the test the "cucumber-reports.html" does not exist. Only "image.png" file is generated.
...
1
vote
1
answer
55
views
WebDriver linkText with CSS manipulations
I have an HTML with the following element:
<a href="index.html" style="text-transform: uppercase;">index</a>
I'm using selenium-java 4.8.2, Chrome 112 and JUnit 5.9.2, ...
0
votes
0
answers
2k
views
Getting java.lang.IllegalArgumentException: Keys to send should be a not null CharSequence as the stored value returns null Any leads would be helpful
Scenario:
There are 3 fields in the Screen where i enter a number in the 1st field text box
and i need to enter the same number in the 3rd and 4th text box as well
///So in this case i have created ...
-1
votes
1
answer
351
views
Java selenium - null pointer exception on webDriver inheritance
I am getting null pointer exception. Would you be able to help and what should be fixed ?
java.lang.NullPointerException
at pages.LandingPage.acceptConsent(LandingPage.java:14)
at
stepDefs....
3
votes
1
answer
3k
views
Selenium latest version is not able to launch FireFox browser in Ubuntu 20.04
I'm trying to automate web tests with Selenium and Java in Ubuntu OS.
Earlier versions of Selenium used to work very well with older version of Firefox in Ubuntu.
Since I upgraded to
Selenium 4+ (...
0
votes
0
answers
17
views
Getting NullPointerException while running the simple testNG script
Code as below:
Public class sample {
@Test
Public void test() {
Syso("hi");
}
}
0
votes
1
answer
634
views
Facing challenges to run java selenium tests with gitlab runner
I am trying to run cucumber maven tests on gitlab ci using selenium grid, from the output I have observed that containers for grid setup are up and running.
But I am not able to run my cucumber tests ...
0
votes
0
answers
4k
views
org.openqa.selenium.interactions.MoveTargetOutOfBoundsException: move target out of bounds
I am passing input to rich text field. For that I have written the code below:
public void inputToDescriptionField() throws InterruptedException , AWTException
{
wait.until(...