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
0answers
9 views

When i run my appium code i am getting this error “Exception in thread ”main“ java.lang.NoClassDefFoundError” which i am not able to understand why?

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. ...
0
votes
1answer
32 views

What is the purpose of this constructor pattern

class LoginPage(){ ///line of code public LoginPage(WebDriver driver) { this.driver = driver; PageFactory.initElements(driver, this); } Can someone please explain the ...
-2
votes
2answers
70 views

Selenium WebDriver issue

I am getting: "Exception in thread "main" java.lang.Error: Unresolved compilation problem: Type mismatch: cannot convert from FirefoxDriver to WebDriver" error in the console I have added jars files ...
0
votes
0answers
29 views

calling TIS/TSM in non-main thread environment

macOS 10.14.3 Chrome 72.0.3626.96 Chromedriver 2.46 While trying to execute following code I receive an error: import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa....
0
votes
0answers
7 views

How to activate rules in SonarQube which are listed only in pmd.xml in maven project

For the SonarQube report, I have listed some rule sets in the pom.xml file in a maven project, I need to deactivate all rules in sonarQube and need to generate the SonarQube report only for listed ...
0
votes
1answer
44 views

Null Pointer Exception

Pls help me with this error "java.lang.NullPointerException". Chrome driver is getting initiaze properly but at the time of running test it is giving this error.In my test class I'm extending setup ...
0
votes
2answers
67 views

How to automate when you do not get any id or xpath

I have a scenario where I need to sign in using Facebook, so when I used UiAutomator viewer to inspect I am not able to find any element. So how to perform automation in such cases.
1
vote
1answer
51 views

Unable to locate element Selenium: Shopify Payment Gateway [closed]

I receive this error whenever I try to click on the Shopify credit card text field. org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: {"method":"id","selector":"...
0
votes
2answers
28 views

How to find an new element recently added on webpage dynamically after drag and drop in selenium?

Currently I am working on a webpage which has rappid js components. I am trying to achieve dragging and dropping of elements from the palette as seen in the screenshot to the grid. The element I drag ...
0
votes
1answer
46 views

Use Login method before test

I use POM pattern in Selenium tests. To run tests OpCreate and OpEdit, a user should be logged in. I have positive test for Login, but how to run Login every time OpCreate and OpEdit tests are run? ...
0
votes
1answer
24 views

How to get content of clickable element. Facing issue to read content after clicking an element

I have tried below code: if(webElement2.isDisplayed()) { webElement.explicitWaitToClickElement(4,webElement); webElement2.click(); } String tagContent = (String) ((...
0
votes
0answers
21 views

How to fix DesiredCapabilities error in java appium?

I am getting this error "The type org.openqa.selenium.remote.DesiredCapabilities cannot be resolved. It is indirectly referenced from required .class files" when I compile and run the program. when ...
0
votes
1answer
31 views

Not able to switch back to the parent window of Internet Explorer 11 using selenium (java)

Description: I know how to switch back and forth from Main window to Child Window and vice versa. But for some reason the same code doesn't seems to be working on Internet Explorer 11. I have ...
0
votes
0answers
22 views

Getting this error when i run my java appium script

When I save and run the code the compiler is showing error with respect to DesiredCapabilities I thought I might have made an error while importing the jar so I uninstalled everything and installed it ...
0
votes
2answers
68 views

Type mismatch: cannot convert from ChromeDriver to WebDriver

I am getting the following Exception: Exception in thread "main" java.lang.Error: Unresolved compilation problems: Type mismatch: cannot convert from ChromeDriver to WebDriver The method get(...
0
votes
1answer
26 views

How to get total number of tests ran based off of CSV data file?

I inherited two dozen or so java tests and when the suite is ran, everything is printed whether passing or failing. I would like to only print failures/failure logs and get a total count of tests that ...
0
votes
0answers
36 views

Multiple url passing

browserName=chrome adminUrl =https://landingsite.webapp.com/ AdminUserName =demoeu@yopmail.com AdminPwd = 1234 landingUrl=https://testing.app.com/ AdminUserName =demoeu@yopmail.com ...
0
votes
2answers
50 views

How to integrate/merge multiple extent reports into one single report using selenium, extent report v3xx

I am running selenium scripts using jenkins jobs/multijob and its creating multiple html reports for different modules. How can we combine/merge all html reports to one single report? Extent report ...
1
vote
0answers
31 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
2answers
47 views

WebDriver cannot be resolved to a type

"The import org.openqa cannot be resolved". "WebDriver cannot be resolved to a type". "ChromeDriver cannot be resolved to a type". This type of error occured when writing TestNG program. Before ...
0
votes
1answer
45 views

Static dropdown is not working correctly

Can someone tell me why Public class dropdown is not working, I mean program is not selecting value from static dropdown. import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import ...
0
votes
2answers
40 views

Automation Failures from multiple tests in one CSV file

I inherited a couple dozen automated java tests that write test result failures to individual CSV files. Instead, I'd like to write to one CSV file with separate tabs per test. I haven't found how or ...
2
votes
4answers
88 views

How to deal with huge PageObject using POM in Selenium?

I've got a question about dealing with huge PageObject. In the website that I'm currently testing there is a form with circa 50 inputs/dropdowns/selects. In the current state my class got about 900 ...
0
votes
0answers
11 views

Check file generated in Selenium IE [duplicate]

Need to check file is generated. For example, If one filter is given it will generate file in minute, if we give more than one filter then it will take more time. How to do that is selenium and junit
1
vote
1answer
24 views

Tree of HTML from JSoup?

I can see why the two iterate methods get caught in an infinite loop calling each other but can't see how to reasonably prevent this. I suppose I could have a counter to simply limit the depth. But, ...
0
votes
1answer
53 views

Dynamic XPATH by for loop in selenium web driver

I'm trying to write dynamic XPATH by for loop in java selenium WebDriver but I couldn't do it. There's a webpage and I have to print the string content which are in the xpaths mentioned in follow. /...
1
vote
0answers
43 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
votes
1answer
53 views

Me being a Automation Tester (QA), how can I win a Ideathon? What should I develop for Ideathon? [closed]

I have over 9 years of experience in Automation. Still, I think my Java coding skills are limited. Having said that, if I target to win Ideathon 2019, what should I develop?
0
votes
1answer
38 views

CSS parsing to check color value [duplicate]

I need to make a script that checks if all h1 tags in a page are of a certain hex color. If they are not, test fails. What are the available options for doing this? I'm using selenium with java
0
votes
1answer
40 views

How to read multiple test data files in same script?

I'm trying to use data in multiple test data files in the same script here. Suppose there are 2 data files with login credentials (Login1.csv and Login2.csv). I need to use credentials in Login1.csv ...
2
votes
1answer
68 views

Selenium exception is reported twice in logs

I am using Cucumber Page Object model to execute my tests. Here is my POM file:- <dependencies> <dependency> <groupId>info.cukes</groupId> <artifactId&...
1
vote
2answers
53 views

How to run same Selenium/testNG project in a different environment with different credentials?

Currently, I'm running a selenium script in one environment (on-premise) with separate login credentials. There are 5 different users and they have separate login credentials. Suppose there are 50 ...
2
votes
2answers
79 views

How can I find element and insert text on this page?

The problem is that I cannot find and enter the text in the fields <input onkeyup="$('#firstname').val(this.value);" type="text" class="is_required validate form-control" data-validate="isName" id=...
0
votes
2answers
37 views

How to make sure http request completed then proceed to next request using jmeter

Recently I am new to Jmeter, I have 9 HTTP requests and I want to make sure all the threads must run accordingly in order to complete the whole task in my project. Moreover, I do not think that adding ...
0
votes
2answers
29 views

How to click on Submit button from POP-UP window if submit button is available after scrolling page to down?

I am submitting a form value's through selenium and java. On the form initially I'm searching a product and selecting some values. Then it's showing a pop-up window with scroll to the pop up; see the ...
0
votes
2answers
69 views

Selenium UI Tests folder structure

I'm really new here and started writing some UI tests using selenium and testng and wanted to know how do you structure the folders, it is a maven project and using java. I'm putting all the test ...
0
votes
1answer
75 views

Selenium does not click on radio button on pop up

On form, there is one binocular. On click on binocular, pop up opens. There are radio buttons on pop up. I need to click on radio buttons, it's failing. I have tried below code but it shows error ...
4
votes
3answers
327 views

How to modify HTTP request header in Selenium WebDriver with Java?

I want to add "iv-user" request header to log into web app. I'm using the newest ChromeDriver. Using extensions like ModHeader or ModifyHeaders is not working in this case. Fiddler is working, but I ...
1
vote
1answer
26 views

Do Test Runner and Testing Framework exists separately in Java?

As per my knowledge, test runner is any software that takes testing code and as per the configuration, executes the code and collate the results while the testing framework is basically the name given ...
2
votes
1answer
47 views

How to select list items using button in selenium webdriver?

Here is code that I am using firstly I am clicking on the button then the list of items is shown and I try to select from the list but it said that Index=0, Size=0 when I use Xpath. When I use the ...
2
votes
2answers
60 views

Getting Nullpointer Exception

While i run this below code i am getting Null pointer exception. import java.util.concurrent.TimeUnit; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import ...
0
votes
2answers
38 views

How to upload file if the browse button is placed in iframe.?

I am trying to upload a file using "sendKeys" on iframe but its always opening Browse window instead of uploading file. following is my code driver.switchTo().frame(3); WebElement UploadElement=...
0
votes
0answers
17 views

Is there a method to perform sql inject for prepared statements?

I've been trying to learn sql injection and tried perform on a site that we developed. Following code is sample code taken from internet. I want to know is there a way to do sql injection even on a ...
-1
votes
1answer
68 views

Want to test ebay site login without using Xpath

I want to test the Ebay site login, without using Xpath. It is not working, right now. I tried for hours to make this work. Please tell me what I am doing wrong and how to fix it. This is what I am ...
0
votes
1answer
25 views

Tidy HTML with BaseX

How do I tidy this HTML for baseX? Working from a basic example. Looks like the HTML isn't valid, or at least baseX has apparent problems with parsing it: thufir@dur:~/NetBeansProjects/...
1
vote
1answer
46 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 ...
0
votes
2answers
92 views

How to store elements in a list of String array in a java array? [closed]

I have data stored in a list of String array (List<String[]> data = reader.readAll();) and I'm trying to store them in a java array (value). Please see the below code. data is getting stored in ...
1
vote
1answer
50 views

POM: driver is passed as an argument? Always?

Example code: Driver is being passed as an Argument so that Selenium is able to locate the element on the browser (driver). Element is returned, so that an Action can be performed on it. ...
2
votes
0answers
46 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 ...
1
vote
1answer
116 views

Selenium/Java reading CSV file using open csv

UserName,Password User1,Pwd1 User2,Pwd1 User3,Pwd3 Assume there is a csv file with user names and passwords as I've mentioned above. I need to read the csv file and store data in a hash map using ...