|Incorrect URL displayed upon using driver.getCurrentUrl() in Webdriver, Selenium|
This shouldn't be happening but anyhow you can use
|How to handle Handle the dynamic element ids in Selenium Webdriver|
Checked with site yahoo.com site. I have modified
my code since the name/ids were different for
chrome and firefox. The below code works fine with
Chrome and Firefox.
Try the below code:
WebElement user =
ID' or @placeholder='Yahoo username']"));
WebElement password =
|Selenium Webdriver unable to click the sub menu item|
Try this code instead:
for 20 seconds for the final element to be
|Reuse the browser session for Selenium WebDriver for Nightwatch.js tests|
Reuse of session is not good idea as you may run
tests in different oreder, but
You could place login code into before function or
even extract it into custom commands.
1 - In nightwatch config add
2 - Create custom-commands/login.js
|Advise on locating elements on a webpage I am building a selenium script for|
XPath and CssLocators are pretty flexible since
they support multiple ways of identifying an
element. I'm not sure you'll find a better
alternative. This is a good reference for what
they can do.
Your approach is pretty rigid in that your xpath
string specifies the full hierarchy - the element
you're searching for plus all its parents. If any
element in that hierarchy changes or gets
|Selenium IDE - Inconsistent Link Behaviour|
I've never seen situation like this, but i think
you can handle it by using few available
Use waitForPopUp and then selectPopUp to switch
focus to the new tab.
All your operation will take place in new window.
Use close to close newly opened window and then,
use selectWindow to select your original window.
How to handle situation when you don't know if
popUp showed up?
Use gotoIf fun
|Selenium Tests not working on Jenkins with Chromedriver, Chromium and xvfb|
You are using a very outdated version of Selenium.
Typically, the newer Chrome versions might not
work with older version of Selenium.
Try updating to Selenium version 2.44.0
I'm willing to bet this will fix your issue.
|How to write rightclick method in selenium testng|
Assuming "objlocator1" consists of xpath of the
webelement to right-click on.
public static void rightClickOn(String
Actions actions = new Actions(driver);
|Any idea for executing Selenium webdriver + Java/Python tests from Cloud|
Here's a global idea:
Use Amazon Web Services.
Using AWS, you can have a setup like this:
1 Selenium Grid. IP: X.X.X.X
100 Selenium nodes connecting to
Each Selenium node has a node config, running 2
maxSessions at once. (depending on size of course)
Have also, a Continuous integration server like
Jenkins, run your Python tests Against X.X.X.X
|getting error with chromedriver using RemoteWebdriver|
Try below :
driver = new ChromeDriver();
Put chrome driver in properties folder.
|how to get text from text node without getting content of siblings|
How to do it using only XPath 1.0? Is it
Yes - and it's rather trivial:
I wonder why you did not try that? All other text
nodes are either in a p or span element and should
not cause you any trouble.
|Is it possible to add selector text to a By object|
Put the "div.popup" in a string say "str" like
String str = div.popup
Then you can append ".cart" to the string, make it
"div.popup.cart", and use the cssSelector as:
By selector= By.cssSelector(str+".cart");
Note:- Above is a java code.