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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
9 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 ...
Yulyan Paulouski's user avatar
0 votes
2 answers
83 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 ...
qa235's user avatar
  • 1
0 votes
0 answers
21 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-...
ChathuD's user avatar
  • 2,149
0 votes
1 answer
37 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 ...
Keith's user avatar
  • 11
0 votes
1 answer
60 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 ...
Thea's user avatar
  • 11
-1 votes
1 answer
135 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 ...
Mohib's user avatar
  • 1
0 votes
1 answer
95 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(); ...
invzbl3's user avatar
  • 121
0 votes
1 answer
79 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> ...
invzbl3's user avatar
  • 121
0 votes
0 answers
427 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\...
Resha's user avatar
  • 1
0 votes
0 answers
139 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> ...
invzbl3's user avatar
  • 121
-1 votes
1 answer
96 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( ("//*[...
invzbl3's user avatar
  • 121
-1 votes
1 answer
37 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....
Nethmi Edirisooriya's user avatar
0 votes
0 answers
28 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....
Landry Messina's user avatar
0 votes
2 answers
54 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 ...
Krishna Sriram's user avatar
-1 votes
1 answer
53 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....
Amit Dwivedi's user avatar
0 votes
0 answers
115 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 ...
likenzy's user avatar
0 votes
0 answers
511 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[] ...
ChathuD's user avatar
  • 2,149
1 vote
1 answer
470 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 ...
iAutomate's user avatar
  • 359
0 votes
0 answers
51 views

How to select drop-down value from CSV file using Apache POI - Selenium Java

I am currently working on a web form (Selenium Automation) where I need to display values from a CSV file in a drop-down input text field. I've managed to read the CSV data using Apache POI and ...
Anony's user avatar
  • 1
-1 votes
1 answer
89 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 ...
saltine springs's user avatar
-1 votes
1 answer
30 views

This element is working on Jenkins previously, but not working now on Selenium Java Cucumber BDD framwork. I am facing this issue consistenly

Results : Tests in error: invalid selector: Unable to locate an element with the xpath expression None edit reseller content lib because of the following error: SyntaxError: Failed to execute '...
Ammar Ahmed's user avatar
-1 votes
1 answer
112 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 ...
Ammar Ahmed's user avatar
0 votes
0 answers
253 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("--...
invzbl3's user avatar
  • 121
0 votes
1 answer
165 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("...
user3021955's user avatar
0 votes
2 answers
902 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 ...
Helly's user avatar
  • 1
0 votes
1 answer
134 views

How can I run all the tests of a class sequentially using each dataset from @DataProvider in TestNG

I have a test class with few tests in it. A data provider which takes data from excel sheet. What I am trying to achieve is having one data set, say dataset1, and run all the tests of the test class, ...
Pypal's user avatar
  • 31
0 votes
1 answer
58 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-...
AAa's user avatar
  • 1
0 votes
1 answer
241 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 ...
Jason Krynicky's user avatar
0 votes
1 answer
53 views

Execute same test scenarios in two different browsers simultaneously

We have created web automation scripts for particular website. And now the manual QA team requested to automate mobile responsiveness as well so we are using below code to achieve mobile ...
Darshani Kaushalya's user avatar
0 votes
1 answer
39 views

Multiple verifications under one test - if one of the verification fails how to continue to verify the remaining

I'm working with selenium/Java /TestNG Maven project. Main function calls multiple validation from java class. If any one of the verification fails, the remaining are skipped. From the below code if, ...
Padmaja's user avatar
0 votes
1 answer
131 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 ...
Nzall's user avatar
  • 485
0 votes
0 answers
35 views

why my page is not scrolling full at the bottom in selenium testNG(java)?

The images below are my codes(Singleton,homepage and test classes) I'm new to automation and I tried to achieve POM using Singleton now my problem is whenever I try to run my test cases it navigates ...
Shabbin Hossain's user avatar
0 votes
1 answer
134 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 ...
invzbl3's user avatar
  • 121
0 votes
1 answer
170 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. ...
ChathuD's user avatar
  • 2,149
0 votes
1 answer
25 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 ...
Jahanzaib.Khan's user avatar
-1 votes
1 answer
31 views

I am manually putting ID generated via POST method in PUT,GET method, How to Auomate it

ISSUE- Using post method, ID get generated in response(id=ff80818188956aa6018899e27b76038b), now I don't want to put this id generated in PUT,DELETE,GET, manually(as I am doing below) Can you please ...
chinmay k's user avatar
0 votes
0 answers
41 views

Ashot compatibility with Windows zoom

When i try to use Ashot to take screenshots of errors on my pc i have a probleme where the images of the website arent taking completly. What we have when we execute the code : What we want : When i ...
Yan's user avatar
  • 11
-1 votes
1 answer
24 views

I have a method where i have taken the rowcount of 10 records on page load and 15 records after changing the page no to 15 question how to validate

I have a method where i have taken the rowcount of 10 records on page load and 15 records after changing the page no to 15 question here is how to validate by creating a Assert method seperatly in ...
user56056's user avatar
0 votes
1 answer
106 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 ...
user56056's user avatar
0 votes
1 answer
85 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 ...
ChathuD's user avatar
  • 2,149
-2 votes
3 answers
945 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
662 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....
javabeginer's user avatar
0 votes
2 answers
5k 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&...
javabeginer's user avatar
0 votes
0 answers
1k 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....
javabeginer's user avatar
0 votes
2 answers
521 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. ...
javabeginer's user avatar
1 vote
2 answers
51 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, ...
mt85's user avatar
  • 13
0 votes
0 answers
38 views

Have a Screen whereI once click on the text box the up and down arrow will become visible to click but it is not clicking and is not throwing a error

I added this piece of code: Any inputs to get this working would be helpful WebElement inputElement = driver.findElement(By.cssSelector("input[type='number'] [formcontrolname='sample']")); ...
user56056's user avatar
0 votes
1 answer
1k 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 ...
user56056's user avatar
-1 votes
1 answer
284 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....
javabeginer's user avatar
3 votes
2 answers
2k 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+ (...
RonyPatricks's user avatar

1
2 3 4 5
30