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.

194 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
2answers
712 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 ...
4
votes
2answers
2k views

Getting Unknown error While Using latest Verison of Selenium With Microsoft Edge Browser

My Code to launch Browser: System.setProperty("webdriver.edge.driver", "C:\\selenium-drivers\\MicrosoftWebDriver.exe"); DesiredCapabilities capabilities = new DesiredCapabilities("MicrosoftEdge", "", ...
4
votes
2answers
1k views

How to pass arguments to selenium from autoit script

Autoit has a order value ,which I want to pass it to database as argument to get table contents of that order id. I tried passing from command line ,but I don't want the arguments to get passed from ...
4
votes
1answer
2k views

Dependent methods in the same class run out of order only when included in a “testng suite”; running class independently respects the dependency

I have a class with dependent methods using the TestNG annotation dependsOnMethods The test runs fine 100% of the time if I simply run it as a TestNG Test from the package. When I include the test ...
3
votes
2answers
179 views

Verify if selenium tests are running on real devices or emulators

If I use any cloud provider (eg SauceLabs, AWS Device Farm etc) for testing my native android and iOS apps, is there a way to determine if the test was being run on a real device or an emulator. I ...
3
votes
1answer
4k views

List of webelements getting cleared during my test run?

I'm trying to compare two different tables using the method called VerifyOrderSummary located at the end of the main method below. public static void main(String[] args) { // TODO Auto-generated ...
3
votes
1answer
1k views

How do I disable 'show all' download bar of chrome in selenium

I need to disable 'show all' download bar of chrome in selenium. Because the download bar is showing, UI elements in the lower portion of my page that need to be clicked are not visible. I'm looking ...
3
votes
1answer
831 views

How can I execute a stored procedure on sql server and get the result passing in 4 parameters?

How should I be adding this functionality into my test framework? Should I be using Hibernate or standard JDBC? I need to run a stored procedure which exists in one of my databases, pass in 4 ...
3
votes
2answers
454 views

Running Junit test parallely with csv test data

I have a csv test data file with 50+ test data in it. I want my JUnit test to process these 50+ test data in parallel than serially. How can we do that? Is there a framework that can do that? Junit ...
3
votes
3answers
1k views

C++ app automation on multiple platforms

Need to automate C++ application testing on Web, Mobile (iOS, Android) and Desktop (Windows, OSX and maybe Linux). Searching for open source tools only and automated tests will be written using Java. ...
3
votes
1answer
216 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 ...
3
votes
3answers
108 views

Is there a way to automate tests to verify events being broadcasted?

Currently I manually verify events being sent and received in the console by opening the dev tools in chrome. The testing is going to scale up and be repetitive soon. Any idea on how I could possibly ...
2
votes
0answers
38 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
83 views

Scrape items from an HTML list

When Catalog receives a fragment for a book category, it seems to my eyes, to be just list items. For space, I didn't include that output. How can I ensure that only categories which belong to the ...
2
votes
0answers
160 views

decompose an HTML list with page fragments

note: Looking for simplest possible example of PageFactory and fragments. I've been referencing an article which uses additional libraries I wasn't aware of. The desired structure: Where there's ...
2
votes
0answers
62 views

how to enable assertions through the Gradle Kotlin DSL?

The simplest possible assert usage I could think of: thufir@dur:~/NetBeansProjects/helloAssertions/src/main/java$ thufir@dur:~/NetBeansProjects/helloAssertions/src/main/java$ ls App.java thufir@dur:~...
2
votes
1answer
81 views

How to improve slowness of my automation code?

I am doing automation. But my code working takes more time. I am taking index value from deDupStringList array. for click on the gui application. I read the data from back end. This is my entire ...
2
votes
2answers
528 views

Drag and Drop does not work with headless chromedriver

I am automating drag and drop using Selenium and Java. Following is the code used for performing drag and drop using chrome driver in headless mode. Point classname = targetElement.getLocation(); int ...
2
votes
0answers
588 views

How can I make my solution thread safe for testNG parallel execution?

Background: For quite some time I have ran automated tests using forked JVM processes, this proved quite easy when injecting a driver object using spring, I could simply provide the following: @Bean(...
2
votes
1answer
3k views

Bypass certificate error in IE

I have tried over and over again to get the Internet Explorer Driver to bypass bad cert errors in WebDriver. Currently I do this: driver.navigate().to("javascript:document.getElementById(‘...
2
votes
0answers
248 views

Duplicate annotation Error in appium

I'm working in appium in ubuntu pc .There is a duplicate annotation error in my code public class ChainViewPageObjects { @AndroidFindBy(className = "android.widget.ScrollView") @...
2
votes
1answer
11k views

Looping through a Table with separate colums and clicking on an item within it

I would like to loop through a list of div classes that is dynamically generated in two columns (fixed), rows (dynamically generated). I would like to select a button on the second column with a group ...
2
votes
0answers
2k views

Can't run tests from Cucumber feature.file (cucumber.runtime.CucumberException:)

I can run my tests from my runner class without any problem. Here is my Runner-class: @RunWith(Cucumber.class) @CucumberOptions( format = {"pretty", "html:target/cucumber"}, glue = {"...
2
votes
0answers
288 views

Java + Appium + iOS [mobile] : How to fix error “Error: spawn ios_webkit_debug_proxy ENOENT”?

I am trying to automate web app on iPhone using Mac. Executing webkit debug proxy for automation on iOS platform. I am facing below issue: RUNNING: ios_webkit_debug_proxy events.js:141 throw ...
2
votes
3answers
1k views

How to get Selenium 3.0.1 to work on a Mac with IntelliJ

I am using a Mac as well as IntelliJ. I am trying to update Selenium from 2.53 as the website I am testing has functions that no longer work with older versions of Firefox (version 46). I am trying to ...
1
vote
1answer
62 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 ...
1
vote
1answer
15 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 ...
1
vote
1answer
26 views

Regarding reading Jmeter output in Java

I have executed jmeter script through java, however I am not able to get output in java. Could you please help me in that. Regards Pankaj
1
vote
1answer
308 views

Logging js console when doing selenium test using firefox driver

I'm writing selenium tests which are launch on the firefox (gecko) driver. If a test fails, I want to retrieve the log present on the firefox js console. In order to do that, I have added the ...
1
vote
2answers
260 views

Unable to find element with xpath within nested framesets

I'm using driver.findElement(By.xpath("//a[@title='A K T İ V A S Y O N']")); to locate the element given below in the screenshots but getting Unable to find element error. There are nested classes ...
1
vote
1answer
35 views

High-level help desired in forming a plan of attack for testing of background “cleanup” tasks

I have written and continue to maintain a fairly complex back-end service written in Java that scrapes arbitrary web sites, involves long-running processing jobs, and includes background tasks that ...
1
vote
1answer
80 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; ...
1
vote
1answer
198 views

Compare 2 JDBC response in Jmeter

I want to compare 2 JDBC responses: I have Source reponse from 1 JDBC request as below in table format: (Source DB)JDBC Response response1: (Target DB)JDBC Reponse 2: I am saving the response as ...
1
vote
1answer
285 views

click getting to lower item(under dropdown) instead of dropdown in selenium

I m trying to click on the dropdown menu item and i am able to select the dropdown and the menu item but instead of clicking on item the click is going to the element right under it. Before the ...
1
vote
0answers
34 views

Architecture of WebDriver-based GUI tests. How to break base helper into smaller ones?

I create automation tests for web using WebDriver and now architecture is like this: Description: HelperBase.java: contains extended methods for WebDriver which could be used in any project, they ...
1
vote
0answers
47 views

Facing Timeout issue while earlier this code was working

import java.util.List; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; public class Test1 { ...
1
vote
1answer
84 views

Unresolved reference: enableAssertions

working assertions example using standard Java SE with no imports: thufir@dur:~/jshell$ thufir@dur:~/jshell$ javac App.java thufir@dur:~/jshell$ thufir@dur:~/jshell$ java -ea App Exception in ...
1
vote
0answers
76 views

Unable to call custom annotation in selenium test

Unable to call custom annotation in selenium test i am writing a Apache poi selenium junit test - To avoid @RunWith i have tried myown annotation public class MyTest extends OtherTest { String a ;...
1
vote
1answer
675 views

Caused by: org.openqa.selenium.NoSuchWindowException: no such window is displayed in Geb

I have a written a Geb script for automation and I need to handle the Popup. but when switching the child window to parent window am getting a No Such Window Exception Below is my code: def ...
1
vote
1answer
850 views

How to get only one row from excel which has multiple rows data?

Actually, I have written code for reading data from an excel file. But, I want to read the first row and if required then read the second row which is not happening in my code. I got all rows data ...
1
vote
5answers
5k 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/...
1
vote
0answers
53 views

Record UI elements for TestFX

There is an existing JavaFX based application, which I should write automated tests for. I just started to use TestFX(version 4.0.13-alpha) and looking for advice, how to record and identify UI ...
1
vote
0answers
580 views

How to handle password alert pop up (Windows Security) on IE?

The pop up is not the traditional alert. It looks like this pop up. Basically Windows Authentication system. I have tried the classical alert handling technique (alert.sendKeys()) and the one using ...
1
vote
3answers
734 views

How to handle tooltip on onmouseover in selenium java

test case is to show the tooltip message my html code is below <td id="pendingBalance" align="right"> <a onmouseover="displayHelpPopup(this,arrHelp[20][0]);" onmouseout="closePopup();" ...
1
vote
0answers
327 views

how to interact the video in java selenium

I have a test case with video. Test Case scenario: There I want to check whether the link in the website and when we clicked that link played video link are same. [![Highlighted is linked to video][...
1
vote
1answer
4k views

How to capture error message from the toaster using selenium with java

I am searching for something specific, from a dropdown and want to capture the error message when no results are found. The message to be displayed from the toaster is "No Records Found"
1
vote
0answers
432 views

Unable to Switch to iframe in IE

Code Trails: driver.switchTo().defaultContent(); List<WebElement> before = driver.findElements(By.tagName("iframe")); for (WebElement t : before) { System.out.println("iframe" + t....
1
vote
3answers
2k views

How to resolve NoSuchElementException in Selenium with java?

CODE: driver.findElement(By.name("USER")).sendKeys("XYZ"); driver.findElement(By.name("PASSWORD")).sendKeys("abc"); I have tried various ways not just name but by xpath, css selectors but every time ...
1
vote
0answers
394 views

How to control order of testNG package test execution without Priority or Dependency?

I have a package containing the tests I want to run. There are no priority or dependency setings at the testcase or suite level. <suite thread-count="1" name="reg 1"> <listeners> ...
1
vote
1answer
417 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 value which will throw error I clear the text box and add valid ...