Search Results
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 |
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 …
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 …
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 …
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 …
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 …
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 …
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 …
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 …
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 …
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 …
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 …