Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 19538

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.

3 votes
Accepted

Using POM with java

You need to create methods (actions to be done on the elements) in your page object like the following: Page Object class POMLogin { // Web Elements public void login() { UsernameTxtBox.sendK …
the_coder's user avatar
  • 754
1 vote

Software Quality - checkbox and radio

From the above html provided, It is clear that the input tag is of type='checkbox'. And you are trying to perform actions related to a select tag (like selectByValue) on an input tag of type checkbox …
the_coder's user avatar
  • 754
3 votes

How to verify using assert command?

Assert is failing because assertEquals() is trying to compare an WebElement with a string. So, Store the respective element in a variable and then use getText() method on the element, which would ret …
the_coder's user avatar
  • 754
1 vote
Accepted

Error in my page

If I understand this correctly, You should not put "pathToGekoDriver" in your code. There you should mention the path where the gecko driver is installed like: System.setProperty("firefox.webdriver.m …
the_coder's user avatar
  • 754
4 votes
Accepted

how to convert WebElement to string in selenium using java?

You can do something like the following: List<WebElement> links =driver.findElements(By.xpath("//*[@id='content']/table/tbody/tr/td[2]")); String []linkText =new String[links.size()]; int i=0; //St …
the_coder's user avatar
  • 754
1 vote

How to handle StaleElementException when I only need to findAllElements one time

You can do something like the following: public void navigateToEachPage() { //Finding all the elements List<WebElement> links = driver.findElements(By.tagName("a"));; System.out.println(l …
the_coder's user avatar
  • 754
3 votes
Accepted

GeckoDriver error in TestNG that works in plain JAVA

The syntax for setProperty() method is: System.setProperty("<driver we want to use in the program>", "<path where the driver exists>"); As per the question, In java you have mentioned …
the_coder's user avatar
  • 754
0 votes
Accepted

Selenium Java: Checkbox in MikroTik

Please try the following: driver.findElement(By.cssSelector("span.checkbox input")).click(); As, span tag has a class attribute .checkbox it can be used as above. We need to click the input tag wit …
the_coder's user avatar
  • 754
2 votes

How to get List of similar elements using javascriptexecutor using selenium webdriver

List of similar elements can be found by JavascriptExecutor using selenium webdriver in following way: JavascriptExecutor js = (JavascriptExecutor)driver; List<WebElement> eles = (List<WebElemen …
the_coder's user avatar
  • 754
0 votes

java.lang.NullPointerException occured while implementing driver initialization through inhe...

You were getting NullpointerException because you are declaring another ChromeDriver instance inside the initialize() method and creating an instance of ChromeDriver object whose scope is limited to i …
the_coder's user avatar
  • 754
8 votes
Accepted

Selenium: getPageSource() returns previous pages' source

You may be getting the previous page source code because the getPageSource() method is called before the page arrives to the page you want. One thing I would like to suggest is before getting the pag …
the_coder's user avatar
  • 754