Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
29 views

Multithreading: chromedriver does not open url in second window

Java code in thread function, System.setProperty("webdriver.chrome.driver", "/usr/bin/chromedriver"); ChromeOptions chromeOptions = new ChromeOptions(); chromeOptions.addArguments("--no-sandbox"); ...
0
votes
0answers
33 views

How can I upload a file to dropbox using selenium (Java)?

I am trying to upload a file to dropbox (www.dropbox.com) using sendkeys() but my code is just finding and highlighting the "File Upload" web element on webpage but not clicking it and uploading the ...
-1
votes
1answer
29 views

Select a random category from the Homepage

I want to select a random category from the available categories and to select a random sub-category in selenium(java). Please suggest a method to do this. PFB the screenshot for the homepage.
0
votes
0answers
24 views

unable to execute all methods in classes with testsuite in selenium webdriver [on hold]

I have a class with few methods and another class also with few methods.both classes added in testng.xml when i run suite,only first method with priority 1 is executing in class 1 and next jumping to ...
0
votes
1answer
24 views

Read Data from the Excel file

I have 2 columns in the excel file(Attribute & Value). I have the following rows for the login page(email1-value,password1-value,e-mail2-value and password2-value). I need to store all e-mail in ...
0
votes
1answer
31 views

How to find the immediate nearest value in java

I am doing insert after operation automation, according to my case, whenever insert after the case came.. I want to get the nearest minimum value and select that value... here i am fetching from my ...
0
votes
0answers
13 views

How to select an item in java menu and sub menu with automation tool QTP/UFT?

I am able to select Java Menu and two submenus but in sequence, I am not able to select the fourth submenu. JavaWindow("title:=Java EE - Eclipse").JavaMenu("label:=Window").JavaMenu("label:=...
0
votes
3answers
39 views

How to handle response varying from developer tool to code debugging in chrome?

I'm using RESTassured with Java. Getting response in compressed from UTF16 format. Response varies from developer tool to code debugging in Chrome/Firefox, here variation means some character got ...
0
votes
0answers
15 views

Cucumber report always generate the same html output

I am using net.masterthought Cucumber reporting in my project. Regardless of how many tests I add, my report always stay the same. I believe this is because of the json file not changing. Below is the ...
0
votes
1answer
32 views

If the row is having decimal, then skip and move to previous until it is an integer value [closed]

I have a scenario to check the insert before automation part..I am read the data from db, I am going through each row by row.. here i am doing insert before operation, thats why i am taking only ...
0
votes
0answers
18 views

Maven-Extent Reports-Exception in thread “main” java.lang.NoClassDefFoundError: com/aventstack/extentreports/reporter/ExtentHtmlReporter

I am using testng to run automation scripts and ExtentReports for report generation. I have a main method that calls the testng.xml file. When i run the main class->Run as -> Java application-> ...
0
votes
1answer
31 views

Need Some Help in implementing a logic for automating a web element using Selenium

Here is the html I am working on, the concept is to loop through the table and fetch all the td values. And based on the first td value, fetch the second td with tag strong inside the td tag e.g: I ...
0
votes
1answer
45 views

How to check if the output value is 4 or not?

Following code isn't working. Please help. WebElement output=driver.findElement(By.id("XLEW_1_3_1")); System.out.print (output.getText()); if (output.getText()=="4") ...
0
votes
1answer
36 views

I am trying data driven testing in selenium, But I am getting the error “Exception in thread ”main“ java.lang.NullPointerException”

package Pack1; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi....
0
votes
2answers
29 views

Cucumber > Saving State up to a Step

I am using Cucumber through IntelliJ and am working on fixing a broken test. I was wondering when debugging, is there a way to save the state of the system up to a certain step in the feature file, if ...
0
votes
0answers
23 views

Appium automation testing a DrawerLayer search box - how to submit?

I am trying to automate typing into a search box in an android app with a virtual keyboard provided through DrawerLayer. I am using Java & Selenium with Appium for running the app itself in ...
1
vote
4answers
76 views

I can use click() function why but not sendKeys() in my code

I`m a novice on selenium testing, and I am trying to login to my instagram but I cant send keys to username but I can click on it. Code: WebDriver driver; public void invokeBrowser() { try { ...
0
votes
2answers
41 views

How to get a Password reset link from Email by Java API in Selenium Webdriver?

I am trying to get password reset link which is sent to email System.out.println("Email Number " + (i + 1)); System.out.println("Subject: " + message.getSubject()); System.out.println("From: " + ...
0
votes
1answer
57 views

Question about handling random “no such element” exception in WebDriver Java

So here's the setup, we have tests where we fetch test data from excel sheet and iterate over all the rows within a particular test. So, for example, there are tests that create some user profiles, ...
0
votes
1answer
28 views

How do I merge 2 separate lists in java based on index?

Say I have 2 lists. I want to merge both list into 1 list(mergeList in code) and expected output is: [11.65148,48.2490,0 11.6515,48.2490,0 11.6516,48.2491,0 ]. Please suggest. List<Double&...
1
vote
1answer
40 views

How to use class and text attribute together in CSS selector in selenium

I'm working on this site. There is a Next button. I want to click it using CSS selector only. I'm using below code to get the element: driver.findElement(By.cssSelector("span.RveJvd.snByac")) span....
0
votes
1answer
25 views

Locating unique element from a set of elements that only differ by a random string contained in the id attribute

I am trying to locate and loop through a set of elements that contain an id that only differs by a contained string. This contained string is not known prior to the test. My current attempt is to use ...
0
votes
2answers
45 views

Checking if a button is disabled Java/Selenium - isEnabled() always returns true

I'm fighting with the following button, trying to assert that it is disabled: <button _ngcontent-c20 appsymbol="plus" class="btn btn-primary" type="button" disabled> button.isEnabled() returns ...
3
votes
4answers
75 views

How to re-run prior Cucumber Step based on boolean assertion in a later step?

I'm learning to use Cucumber and have a Scenario as follows: Given a standard party And a flight from "UK" to "Europe" When I search And I receive search results Then I can book my holiday In Step ...
0
votes
1answer
64 views

How to compare 2d array with 1 d array? [closed]

I am selecting a respective date. I want to compare 2d array with 1 d array.. but i tried but its not getting for me.. String[] array1= {"06/22/2018 09:00:00 PM","Indiana Fever","Seattle Storm"}; ...
1
vote
4answers
69 views

Katalon or Java+Junit+Cucumber to automate tests?

We are starting to automate web tests, but we don't know what is the best way to do, what is the best option to start and why? And what is the best-easy to use for automate Mobile IOS and Android?
0
votes
3answers
63 views

Unable to click on link - no element found exception using Java selenium webdriver

I am using Selenium webdriver with Java. I need to click on link - Register New Consumer. HTML: <a href="/int/cdms/registrationType.do" target="_self">Register New Consumer<br> ...
0
votes
3answers
49 views

Print all product details in search results using Selenium Java

I am trying to print product details from searched results from this page. This is the function I used for that. @Test(priority = 1) public void printSearchItem() { // print the product details ...
0
votes
1answer
61 views

How to read the row number with having column data?

I'm automating an app and using winappdriver tool with java language for the same. I am selecting a row and click on that row in GUI. Here i am deleting a row , so I am having sequence number and with ...
0
votes
2answers
66 views

Jbehave Vs Robot Framework - pros and cons

Which one is the better option for web application testing - JBehave or Robot Framework? Comparison between JBehave and Robot Framewrok.
0
votes
0answers
34 views

How to select a Certificate by its name in drop down using AutoIt and selenium?

How to select a certificate using the certificate name in the drop down box. I used the below to select certificates by keyboard clicks. I used java, Selenium and AutoIt in Eclipse. To select a ...
3
votes
2answers
86 views

How to use multi dimensional array in java instead of using array list?

I wan to use multi dimensional array in java. instead of using arrayList. I am trying to rework on my code. I automate my app to select a game, but need to store in every row of data in string array......
0
votes
2answers
43 views

How can I pass parameter in xpath?

I am using Java, Selenium Webdriver and Cucumber for my automation.In my feature file I have below statement : And add a room '<x>' The XML code for selecting rooms is shown in below image : ...
0
votes
1answer
94 views

Is possible to handle captcha in selenium, if the captcha is a static one?

My code: public class Test { public static void main(String[] args) throws Exception { System.setProperty("webdriver.chrome.driver", "****************"); WebDriver driver = new ...
2
votes
1answer
78 views

Unable to get failed status if script is stopped or element is not clickable getting all test pass

I'm Unable to get failed status if the script is stopped or element is not clickable getting all test pass how & what assert should I apply to get this resolved please help me package ...
1
vote
2answers
94 views

How to use multi dimensional array list in java?

I am doing automation for my app. Here I am selecting a particular game.. here list array contain 9 data .. like I am fetch gui data and put it into array... how to keep the index size as 3 for outer ...
0
votes
1answer
21 views

Why is one Function call throwing a null pointer exception while the other not?

I have two function calls as shown below in the @Test in the test class, one simply clicks on a webElement and other one performs an action to activate the dropdown (By simply hovering over using ...
0
votes
0answers
42 views

I want to upload file (img/ppt/apk) from the project folder but not by giving xpath of my system file path

I want to Upload the file which can be in format of Png/Jpg/Apk/PPT/Pdf/Word to me web Service Project . Currently i am automating through Selenium webdriver and Maven project with TestNG Framework. ...
0
votes
0answers
18 views

Launch appium desktop programmatically' and link to a testNG TestCase for mac. How do I do this?

I have created a java test class to run appium programmatically . I cannot use a .bat file as I am a Mac user and .bat files only work on windows o/s This is my FIRST appium framework so I am ...
0
votes
1answer
47 views

Negative test automation Commands in Selenium

I need to know where can I find negative methods list for selenium / Java. For example, I just learned about .reverseString() which allows us to use a login name spelled backward (password - ...
1
vote
1answer
97 views

TestNG not executing all tests in suite

TestNG fails to execute all of my tests. XML file looks like this: <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"> <suite name="Guru Test Suite"> <parameter name="...
0
votes
4answers
112 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/...
0
votes
0answers
18 views

Sliding element horizontally

As example Amazon.com I made a JavaScript object Using that object I scrolled down the page But when I selected the element and tried scrolling it horizontally, neither the page is scrolling down ...
0
votes
2answers
62 views

Unable to switch into third window - Selenium

I'm using below code to switch into windows : Set<String> handle=driver.getWindowHandles(); System.out.println(handle); Iterator<String> it=handle.iterator(); String ...
0
votes
1answer
64 views

On calling getcellData() getting no values from excel - Selenium WebDriver

Here is my excel utils class: package utility; import java.io.FileInputStream; import java.io.FileOutputStream; import org.apache.poi.xssf.usermodel.XSSFCell; import org.apache.poi.xssf.usermodel....
0
votes
2answers
69 views

How can I run the same scripts in three different environments

Here is my script: public class VerifyPageContent { @SuppressWarnings("unused") public static void main(String[] args) throws Exception { System.setProperty("webdriver.ie.driver", "...
0
votes
1answer
67 views

Randomly selecting item from list using java selenium

I have the following code snippet <div class="space-10"></div> <form action="/book/index" method="post" class="form-inline" > <div class="row no-margin no-padding"> <div ...
-1
votes
1answer
63 views

How do I get the each row of each value? [closed]

I am fetching data from database, now I need to get each row by value. If I take get(0)-- it is printing first column data for every row... [[Field Goal Missed, Jump Shot, 0 Drew Gooden, , , 12....
3
votes
2answers
117 views

Fetch data from database and put into arrayList [closed]

I am automating my gui app. I am fetching the data from database here data contains 6 player and their position..and now I need to store all the data into arraylist... I need to store all the data ...
-1
votes
3answers
54 views

How to click on the image inside a grid using selenium webdriver?

I have to click on an image inside a grid. Grid elements have dynamic ID's. Therefore it's impossible to capture elements as usual. How can click on this image? I have boxed the image I ...