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
1 vote
1 answer
125 views

Is it possible to make a jar file using Selenium java and Eclipse and run that file on any machine for the testing

I am using Selenium and Java with Eclipse and TestNG. Now I want to make a .jar file for running this test case on another system that doesn't have Selenium and Java. How can this be done?
0 votes
1 answer
76 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 ...
1 vote
6 answers
3k views

Mandatory fields in selenium webdriver not changing the color of the dropdown from red to blue once value is selected?

I am new to Selenium Webdriver , I have an application build in angular 2 and trying to select values in drop down which are mandatory. 1) Select a value from a dropdown; initially the dropdown is ...
-1 votes
1 answer
26 views

Selenium WebDriver Drop Down List Testing With Div where dropdown elements are hidden cant able to inspect

public void clickDropdownOption(By dropdownLocator) { // Click on the div to open the dropdown WebElement dropdown = getDriver().findElement(dropdownLocator); dropdown.click(); // Use ...
0 votes
1 answer
59 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 ...
0 votes
2 answers
417 views

How to locate a link using page object model after mouse over

When I hover over login text there are list of links, i need to select Infostore using Page Object model approach. I am new to Selenium could any one help. I have the outer HTML for you: <div ...
0 votes
1 answer
53 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
1 answer
57 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
58 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, ...
0 votes
2 answers
3k views

how to load chrome profile with Selenium

So I am trying to write a test in which the first step is logging in, but it is denying me access as it detected automation tools because the javascript has not been enabled and there is no profile. ...
0 votes
3 answers
4k views

Test cases stop execution for next test cases after using soft assertion

I have used soft assertion in my test cases, but it stops the execution of all the next test cases. what I know if we are adding soft assertion then particular test case should fail and it should jump ...
0 votes
1 answer
611 views

Unable to locate pseudo element using javascript executor in Selenium JAVA

I am currently having issues with locating an pseudo element for a web page. I have checked other articles to use javascript and tried but it still isnt getting it. Below is a screenshot of what the ...
0 votes
2 answers
193 views

Java Selenium: Custom Assert Message for Multiple Checkbox

I'm working with an automated script for multiple checkboxes that has dependent permissions. Given there are multiple checkboxes Checkbox A Checkbox B Checkbox C Checkbox D Checkbox E When I ...
0 votes
1 answer
1k views

Selenium with Chrome mobile emulator- can't make interactions

I'm starting to get frustrated with Chrome emulator: Using JAVA + Selenium + TestNG I'm testing many of our web applications which runs on few browsers. On mobile browser we have a special design - ...
3 votes
7 answers
4k views

CLEAR Method skipped while running the tests

I'm writing automation script for a page in which there is a text box. The scenario is as follows: I click on the text box and enter a value which will throw error I clear the text box and add valid ...
0 votes
0 answers
27 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
123 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> ...
4 votes
1 answer
305 views

Getting and logging the selenium version used in a groovy project

I'm using Selenium in my Groovy application as a Maven dependency. Now I'm looking for a way to log the used Selenium Version to the console. I tried this: BuildInfo info = new BuildInfo(); def ...
0 votes
1 answer
118 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. ...
1 vote
1 answer
1k views

How to add row elements in selenium?

I want to add today's count. I am new to selenium, and am not getting how to add using selenium. Can anyone suggest a solution? This is my code: package testpk; import org.openqa.selenium.By; ...
0 votes
3 answers
3k views

Iterate through multiple URLs in Selenium

I have to use multiple URLs in same script in Selenium (Java) and have to visit one at a time, perform some operations on the page take a screenshot at the end, and then move one to the next page and ...
4 votes
3 answers
2k views

How to use Jmeter Xpath extractor for multiple run in dynamic API elements

XPath extractor response assertion passed first run but in second run it is getting failed because <name>pc</name> is not coming in API. How to skip this element if it is not coming in ...
0 votes
2 answers
124 views

Does One single script can automate entire matches?

I am automating my windows application. My applications are sports related reporter software. In baseball reporter application i will do testing by the following way : I do enter the commentary from ...
0 votes
2 answers
4k 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&...
0 votes
1 answer
261 views

Unable to double click the list of players from the table in the exact order?

]I'm automating baseball sports reporter application. My application is a desktop application. I'm using winium tool with java language. In my application table contain player names in alphabetical ...
0 votes
2 answers
359 views

How do I click on an element available in a specific row where dynamic row is added?

In the below pic, I need to click on the icon in a row which is newly added and column1 value is stored as global variables. Have used the below code, unable to find a solution. WebElement ...
2 votes
2 answers
4k views

Appium - 'POST /element' cannot be proxied to UiAutomator2 server because the instrumentation process is not running

I am trying to run an automated test in appium, what happens is that the app does get launched however fails to perform any action. Please see error below: An unknown server-side error occurred while ...
-1 votes
1 answer
83 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( ("//*[...
0 votes
2 answers
4k views

Can we access the value of a member or class variable of a test class in the testListner methods

I have a situation where 'xyz' is member variable of my testClass and I want to print some information in my report using that variable only. So I want to access 'xyz' in my 'onTestFailure' listner ...
0 votes
1 answer
33 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, ...
0 votes
1 answer
3k views

Selenium driver.getWindowHandles() is not working while opening new tabs in same browser window

package demo.webtables; import java.util.HashSet; import java.util.Set; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.Keys; import org.openqa....
0 votes
5 answers
756 views

Verify element is visible using selenium and java

I am trying to identify a specific element and perform some actions. This specific element is not available in every element I am looping. Below is the element I'm trying to catch. <span class=&...
0 votes
1 answer
745 views

Unable to tap on Search on android keyboard using pressKeyCode(int) method

I am a beginner in Appium automation. The application I am testing, have this scenario where I need to tap on Search button from the native keyboard. I have tried with pressKeyCode method but getting ...
0 votes
1 answer
946 views

When i run my appium code during run time i am getting this error "Exception in thread "main" java.lang.NoClassDefFoundError"?

I have written a code to launch my app and click on the element, the app is launching but after launching when it is trying to click, I am getting an error which I am not able to understand why. ...
1 vote
3 answers
1k views

Mouse hover action to browser window close button

I have a test scenario where the web application checks for the user's leave intent i.e., mouse hovering from the page to the browser close and then a frame gets triggered. Is there any way to do it? ...
0 votes
2 answers
38 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 ...
0 votes
1 answer
327 views

Selenium controlled Chrome and Edge can't both access webcams

I am using Selenium 4 in java to control Chrome and Edge and other browsers in order to test a video call app. I have a test where I'm starting up 2 different browsers at once in order to get them to ...
0 votes
1 answer
76 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
0 answers
52 views

How to terminate the application and make the launcher return to its call by the stop command?

In question: Need code examples on how to use org.junit.platform.launcher.listeners problems have been resolved: Exit – program interruption Pause (true) – stops work before receiving Pause (false) ...
0 votes
1 answer
21 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 ...
1 vote
7 answers
11k views

Unable to click button using Selenium Webdriver Java

I am trying to click a button through webdriver. After inspecting the button element it highlights to the following: XPath: /html/body/div/div/main/div/div[2]/div/div[2]/table/tbody/tr/td[4]/form/...
2 votes
3 answers
391 views

How to validate if .txt file format is correct as a part of File processing in Automation framework?

In my Selenium+Java automation framework, I need to open a .txt file or any other extension file and then see if the text is in a particular format. Now, I need to see if all lines are in this format ...
2 votes
2 answers
12k views

Caused by: java.lang.NoClassDefFoundError: org/openqa/selenium/WebDriver

I've added all JARS configured chromedriver. Why this error is coming "Error: Unable to initialize main class Practice.test1 Caused by: java.lang.NoClassDefFoundError: org/openqa/selenium/...
1 vote
2 answers
161 views

Selenium Java best practices for handling different languages and locations, and setting dynamic architecture

Im currently working on a platform that has multi-language options and also the language is defined by IP. So Im trying to build an architecture for testing both scenarios dynamically... The domain is ...
1 vote
2 answers
826 views

On selecting the radio button how to get the text of the selected radio button where the text is in the next column

On selecting the radio button how to get the text of the selected radio button where the text is in the next column I randomly select the radio button and then i need to Store the selected Radio ...
0 votes
3 answers
461 views

getText() method is returning all small letters in selenium instead of actual case

When I tried to get text of particular element which is returning all small letters. Hence my assertion has failed. kindly help me to get actual innertext and please let me know is there any other ...
-1 votes
1 answer
25 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
1 answer
2k views

Selenium Webdriver fails to load browser through WebDriverManager

We can run our tests in different browsers in selenium Webdriver, previously we need to executable files to run our test in any browser. But now we can achieve without using exe files & with the ...
1 vote
2 answers
177 views

How to Automate the fields that are text and drop downs. You are not sure that how may fields will be and of which type (text/drop down.)

The situation is that admin sets the Specified fields for the front end user and it is upon admin to decide how many fields he'll set for the user. One thing is that he can only create 2 types of ...
0 votes
3 answers
539 views

Can't Select random months dates using jquery calender

I have Jquery calender in my application. I have task to select dates from different months using Selenium, but I can do only previous month and forward month. Actually I need to select dates from ...

1
2 3 4 5
30