spot7.org logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
  Home » SELENIUM » Page 1
Incorrect URL displayed upon using driver.getCurrentUrl() in Webdriver, Selenium
This shouldn't be happening but anyhow you can use JavascriptExecutor to fetch the current url as: JavascriptExecutor js = (JavascriptExecutor) driver; js.executeScript("return window.location.href").toString();

Categories : Selenium

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 = driver.findElement(By.xpath("//input[@placeholder='Yahoo ID' or @placeholder='Yahoo username']")); WebElement password = driver.findElement(By.xpath("//input[@placeholder='Password']"));

Categories : Selenium

Selenium Webdriver unable to click the sub menu item
Try this code instead: action.moveToElement(hover0).build().perform(); action.moveToElement(hover).build().perform(); new WebDriverWait(driver, 20).until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("#menuClickable_0_6_0_0")));//Waiting for 20 seconds for the final element to be visible. action.moveToElement(driver.findElement(By.xpath("//td[@id='menuClickable_0_6_0_0']//p[.='Bus

Categories : Selenium

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. Example: https://github.com/dimetron/backbone_app/blob/master/nightwatch/custom-commands/login.js 1 - In nightwatch config add "custom_commands_path" : "nightwatch/custom-commands", 2 - Create custom-commands/login.js expor

Categories : Selenium

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 re-ordered i

Categories : Selenium

Selenium IDE - Inconsistent Link Behaviour
I've never seen situation like this, but i think you can handle it by using few available functions. 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

Categories : Selenium

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.

Categories : Selenium

How to write rightclick method in selenium testng
Try this:- Assuming "objlocator1" consists of xpath of the webelement to right-click on. public static void rightClickOn(String objLocator1){ try { findWebElement(objLocator1); Actions actions = new Actions(driver); actions.contextClick(driver.findElement(By.xpath(objLocator1))); actions.perform();

Categories : Selenium

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 X.X.X.X:4444/wd/register 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 grid.

Categories : Selenium

getting error with chromedriver using RemoteWebdriver
Try below : WebDriver driver; System.setProperty("webdriver.chrome.driver", "properties/chromedriver.exe"); driver = new ChromeDriver(); driver.get("www.google.com"); Put chrome driver in properties folder.

Categories : Selenium

how to get text from text node without getting content of siblings
How to do it using only XPath 1.0? Is it possible? Yes - and it's rather trivial: /div/text() 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.

Categories : Selenium

Is it possible to add selector text to a By object
Put the "div.popup" in a string say "str" like this:- 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.

Categories : Selenium


Recently Add
Selenium WebDriver get childerns of a list
Incorrect URL displayed upon using driver.getCurrentUrl() in Webdriver, Selenium
How to handle Handle the dynamic element ids in Selenium Webdriver
Selenium Webdriver unable to click the sub menu item
Reuse the browser session for Selenium WebDriver for Nightwatch.js tests
Advise on locating elements on a webpage I am building a selenium script for
Selenium IDE - Inconsistent Link Behaviour
Selenium Tests not working on Jenkins with Chromedriver, Chromium and xvfb
How to write rightclick method in selenium testng
Any idea for executing Selenium webdriver + Java/Python tests from Cloud
getting error with chromedriver using RemoteWebdriver
how to get text from text node without getting content of siblings
Is it possible to add selector text to a By object
© Copyright 2017 spot7.org Publishing Limited. All rights reserved.