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
2
votes
1answer
49 views

Java Selenium click checkbox

I can’t get selenium to click on this checkbox button no matter what I do. Error: no such element: Unable to locate element: I have used sleep thread timers and wait.until(ExpectedConditions....
2
votes
1answer
69 views

Nested explicit wait does not work in Appium

For example, I'm sending a message. While it's being sent to the recipient it has the resource-id "pending_indicator". When it is delivered, it has the resource-id "delivered_indicator". So, I'm ...
0
votes
1answer
49 views

Class not found - no tests were found - InteliJ

I have a problem with running my Selenium tests in IntelliJ. I import project as Maven, all libraries looks like imported, but when I try to run tests, the following errors appear: Class not found: "...
-2
votes
0answers
17 views

no such element: Unable to locate element: I am getting this error but it also works sometimes. Please help [closed]

I am getting no such element: Unable to locate element even it was working fine before.
3
votes
1answer
252 views

Exception in thread “main” java.lang.AssertionError: expected [3] but found [3]

System.setProperty("webdriver.chrome.driver", "C:\\Users\\srajendran\\Documents\\chromedriver.exe"); WebDriver driver=new ChromeDriver(); driver.get("http://qaclickacademy.com/practice.php"); ...
0
votes
2answers
54 views

How to automate functional regression tests through database data comparisons?

I have a Java batch job application that reads input data from an Oracle database, does a lots of calculations, handles many edge cases, and outputs results back into different database tables. The ...
1
vote
1answer
63 views

How to select a dropdown value in Selenium WebDriver using Java appium?

I am new to Selenium, currently am working on selenium webdriver. I want to select a value from the drop-down. But I am not able to do it because of some error. Also, I want to inform you that in my ...
2
votes
2answers
83 views

Code coverage for Selenium Tests

Is there any tool available to determine the code coverage for my selenium tests? My tests are written in Java having use of selenium WebDriver with BDD-Cucumber implementation in it.
0
votes
1answer
38 views

Find element within another element using explicit wait

I have the following code: List<MobileElement> messages = driver.findElements (By.id ("body_bubble")); //find all messages MobileElement lastMessage = messages.get (messages.size () - 1); //get ...
0
votes
1answer
21 views

Unsuccessful Test Continues to Next Test With No Output

setUp: To save time starting/closing browser, logging in/out, I've started grouping regression tests in common classes. I know there are other ways to do this, this one made most sense for our ...
0
votes
1answer
18 views

Ignoring some test steps depending on variables

I'm using Cucumber + Java + Selenium to UI test an application. I'm using the same set of tests whether my application is deployed in qualification (for tests) or in production. However, when I'm ...
0
votes
1answer
40 views

Count all elements with the specific resource ID on the scrollable view

Here is the question. How can I count all the elements with the resource ID body_bubble on a scrollable view ? When I use the driver.findElements (By.id ("body_bubble")).size() method, it gets only ...
0
votes
1answer
34 views

Webdriver setup error in Eclipse, Mac OS X Catalina

After upgrading Mac OS X to Catalina, I have been trying to execute a very basic script written in Java for Firefox in Eclipse IDE 2018. I've installed Gecko driver already through terminal and it's ...
0
votes
0answers
27 views

How to apply a 'Loop' to map the row element where XPath changes whenever page get's loaded [duplicate]

How to map on to a particular row element say " NCC "where the number of the row containing that element changes whenever page get's loaded. Reference website-guru99 for(int i=0;i<19;i++) ...
0
votes
0answers
33 views

Get list of all hover menus and and their all nested hover menus using selenium

@Test public void MedicineList() throws InterruptedException { driver.get(sitedata.getProperty("Medication_url")); WebElement mainmenu = isElementPresentt("dog_xpath"); ...
0
votes
1answer
25 views

Cannot find an element with Xpath in Appium

I'm new to Appium. Sorry if the question is duplicated, but I did not find the solution. I have a problem - I cannot locate an element using Xpath, but I have no problems locating it using the ID ...
0
votes
1answer
20 views

Cucumber-jvm - Retrieving embedded image from TestCaseFinished event

I have a cucumber plugin where I post my test case results to TestRail using the TestCaseFinished event. It works so far, but on failed steps, I use the scenario.embed method to add a screenshot of ...
0
votes
2answers
47 views

Avoid default selection when selecting random value from dropdown

I have a method below that selects a random item from a dropdown list. This works well mostly, but on occasion it will reselect the default option which is usually "Please Select" or a blank value. ...
1
vote
1answer
52 views

Verifing pdf using Selenium + Java

How can one verify pdf using Selenium + Java? Until recently, I was verifying pdf using Firefox (making sure that the pdf file wasn't empty). This was nice and working fine, but it's not multi-...
0
votes
2answers
33 views

How to rerun failed test from where they instead of from beginning? (TestNG)

Is there any way to re run the failed testcase from the page where it got failed instead of running the testcase from beginning in Selenium Java ?
0
votes
0answers
51 views

Why doesn't 'this.driver = driver', do the same as 'PageFactory.initElements(driver,this)'?

I have a page object with im trying to instantiate so that I can perform methods on it in my tests like goto etc. But when I try to use it with PageFactory.initElements(driver,this);. The browser ...
4
votes
1answer
202 views

Selenium PageFactory vs Page Object Model

I've created a framework in C# using the Page Object Model for fun and am now creating a framework in Java to learn Jenkins etc... also for fun. I have come across the PageFactory concept for Java ...
0
votes
3answers
113 views

Selenium Webdriver sendKeys method sending value twice

I have 6 selenium tests (TestNG) running on chrome and firefox (both up to date versions) which connect to Browser stack to run. the problem is that 1 of the test fails intermittently on Chrome as ...
1
vote
3answers
105 views

One Selenium framework to rule them all (or an actively maintained collection of frameworks)

I am looking for most universal, up to date, open source, selenium framework for test automation. Or at least a number of frameworks for different languages. I am surprised as how every company and ...
0
votes
7answers
101 views

How to handle changing absolute XPath?

/html/body/div/main/div/div/div[2]/div/div/div/div[1]/div/div***[4]***/div/div[2] The div[4] element keeps changing. If a new item comes into the web, the div number changes. How do I handle this?
0
votes
0answers
19 views

Looking for a java library automate third party Java-Swing application without access to the source code

I'm looking to automate a third party java swing application that my company uses. I don't have access to it's source code so a lot of the swing testing libraries like Assert-J won't work. I'd like to ...
0
votes
2answers
84 views

Chromedriver quit() method doesn't close all chrome.exe processes

When I am trying to close the chrome browser using driver.quit() and driver.close(), browser is getting closed but chromedriver.exe process is not getting closed. How can we remove these processes ...
0
votes
0answers
23 views

Java/JNA desktop Application Testing

I am a web developer, so I know what kind of tests need to run on web application before sending it to production. First time I have developed a service for desktop application. That newly developed ...
0
votes
1answer
34 views

What is the best way to create complex json in java?

I want to create a request body to test an API. The request body is a complex JSON as below: { "certificate_registry": { "images": [ { "url": "https://path.jpg" } ], ...
0
votes
3answers
61 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? ...
2
votes
2answers
675 views

How to verify data is saved or not using selenium?

I am using selenium and java for automation. I am adding new data. after a click on save, data will appear on the left side on the top list and I want to verify. I want to get the first text "new aam ...
0
votes
1answer
65 views

Selenium starts firefox but only stays on a blank page

I've been looking at the distinction between webDriver.naviagate.to and webDriver.get and they seem the same. Certainly a web page launches..but then a big nothing burger. Not sure where to start ...
1
vote
1answer
16 views

In gradle 4.6, how to force all tests in a class gets executed first before moving to tests in next class?

I am using Gradle 4.6 with testng. My test suite has tests organized something like these. java class1 { test 1.1 test 1.2 test 1.3 test 1.4 } java class2 java class3 java class4 java class5 All ...
0
votes
1answer
81 views

Selenium for Internet explorer on Jenkins

Recently, my tests started failing. I'm testing on IE11(company policy) on a jenkins windows slave. My tests all hang on the "This is the initial start page" if I'm not connected to the server. If I ...
0
votes
0answers
29 views

Why Junit parser failed when running Jmeter scripts with Bamboo?

* Please note that this is working fine in my local machine jmeter, only issue happening when running with bamboo * Bamboo Script configuration sh /apps/jmeter/apache-jmeter-5.1/bin/jmeter \ -...
2
votes
1answer
72 views

What method should i use to display the country selected from dropdown on console in Selenium Webdriver?

http://demo.guru99.com/test/newtours/register.php For the above site, I am writing a Selenium code to select a country from the drop-down and want to display selected country on the console in ...
1
vote
2answers
222 views

Stale element reference: element is not attached to the page of the document

I would really appreciate if someone could help figure out what the hell is going on with one of my tests. I'm getting Stale element reference: element is not attached to the page of the ...
0
votes
2answers
79 views

How can I test when app requires OTP via SMS?

I am using Selenium with Java to test a web application. The app requires a user to receive a One-Time Passcode (OTP) to authenticate they are who they say they are and to authorize several critical ...
0
votes
4answers
44 views

Save variable from java test class 1 and use variable in java test class 2

I have written the Selenium scripts (page object model) to navigate a website, fill in form data, and submit the form. I next need to verify that the form data was indeed saved in the database. My ...
0
votes
2answers
44 views

How to Handle Dynamic Changing IDs inside a span

How to Handle Dynamic Changing IDs inside a span In XPath? for example : <span id="listv2_f40a0e90dbcc089cae10d48a489619ee_total_rows" style="margin-left: 1px;">2000</span> In this ...
0
votes
2answers
202 views

Unable to navigate to the URL in Microsoft Edge

I am trying to launch Microsoft Edge browser and navigate to google.com but as soon as the browser launches the execution stops and the browser closes. I am getting the below error in the console. ...
1
vote
2answers
67 views

How do I select a random checkbox on the web page?

I have 3 checkboxes on the webpage. Each time, I want to select checkboxes randomly.
0
votes
2answers
51 views

How do I find total number of links on a web page using selenium and java 11?

package exsc; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.By; public class S1 { public static void main(String[] args) { ...
0
votes
1answer
46 views

Selenium: Capture DOM Elements Image

I have an API to capture the image of a particular element in DOM and return them. For that, I have a list of WebElements which needs to be captured into a single webpage. For that same, I have found ...
0
votes
0answers
26 views

Driver does not recognize pop-up's - can not switch

In years it is the first time I saw something like this, when I do a: config.getWebDriver().getWindowHandles().size() The result is always 1, but in fact, there is a main window opened and after a ...
-1
votes
2answers
37 views

Can anyone explain use of Driver Factory and its implementation to get parallel browser at same time?

When do we need to create a Driver Factory ? What advantages do we get over regular initialisation of driver when we use driver factory approach. Also how to initiate parallel browser testing using ...
0
votes
0answers
15 views

PackageRelationshipCollection issue in selenium

Exception in thread "main" java.lang.IllegalAccessError: tried to access method org.apache.poi.util.POILogger.log(ILjava/lang/Object;)V from class org.apache.poi.openxml4j.opc....
-1
votes
1answer
62 views

Extent reports issue in maven project

I am using extent reports in my project but it is showing me error and I am not getting solution for this error: [RemoteTestNG] detected TestNG version 6.14.3 Starting ChromeDriver 75.0.3770.140 (...
-1
votes
3answers
94 views

Selenium exception: element not intractable

WebDriverWait wait = new WebDriverWait(driver, 30); WebElement button = wait.until(ExpectedConditions.elementToBeClickable(driver.findElement(By.xpath("(//div[contains(@class,'...
-1
votes
1answer
31 views

Can I use this library for Junit?

I put this library: import org.apache.commons.io.FileUtils; but it sends an error The import org.apache.commons.io cannot be resolved what library is equivalent exist for Junit?