User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 1 of 1
  1. #1
    Join Date
    Oct 2012
    Post Thanks / Like
    0 Post(s)
    0 Thread(s)
    Total Downloaded

    Selenium webdriver is failed to locate the button

    Hi Everyone,

    Selenium web driver is failed to locate the button. Below is my sample code.

    1. System.setProperty("webdriver.ie.driver","C:\\Prog ram Files (x86)\\Internet Explorer\\iexplore.exe");
    2. DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
    3. desiredCapabilities.setCapability(InternetExplorer Driver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DO MAINS, true);
    4. WebDriver wdObj = new InternetExplorerDriver(desiredCapabilities);
    5. wdObj.get(prop.getProperty("www.XXXXX.com"));
    6. wdObj.manage().window().maximize();
    7. WebDriver.Timeouts timeouts=wdObj.manage().timeouts();
    8. timeouts.implicitlyWait(100, TimeUnit.MILLISECONDS);
    9. RemoteWebElement remotewebElement=(RemoteWebElement) wdObj.findElement(By.xpath("html/body/form/table/tbody/tr[5]/td[2]/table/tbody/tr[6]/td/input[1]"));
    10. Point point=remotewebElement.getLocationOnScreenOnceScro lledIntoView();
    11. int x=point.getX();
    12. int y=point.getY();
    13. ((JavascriptExecutor)wdObj).executeScript("window. scrollBy(" + x + "," + y + ")","");
    14. wdObj.findElement(By.xpath("html/body/form/table/tbody/tr[5]/td[2]/table/tbody/tr[6]/td/input[1]")).click();

    I used to find the element using id, cssSelector & name but webdriver failed to locate this button.

    Web driver throws below error at step-9:
    org.openqa.selenium.NoSuchElementException: Unable to find element with xpath == html/body/form/table/tbody/tr[5]/td[2]/table/tbody/tr[6]/td/input[1] (WARNING: The server did not provide any stacktrace information)
    Command duration or timeout: 1.12 seconds
    For documentation on this error, please visit: No Such Element
    Build info: version: '2.21.0', revision: '16552', time: '2012-04-11 19:09:00'
    System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_05'
    Driver info: driver.version: RemoteWebDriver
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at org.openqa.selenium.remote.ErrorHandler.createThro wable(ErrorHandler.java:175)
    at org.openqa.selenium.remote.ErrorHandler.throwIfRes ponseFailed(ErrorHandler.java:128)
    at org.openqa.selenium.remote.RemoteWebDriver.execute (RemoteWebDriver.java:459)
    at org.openqa.selenium.remote.RemoteWebDriver.findEle ment(RemoteWebDriver.java:227)
    at org.openqa.selenium.remote.RemoteWebDriver.findEle mentByXPath(RemoteWebDriver.java:312)
    at org.openqa.selenium.By$ByXPath.findElement(By.java :344)
    at org.openqa.selenium.remote.RemoteWebDriver.findEle ment(RemoteWebDriver.java:219)
    at com.common.junk.OpenBrowser.main(OpenBrowser.java: 70)

    Can any one please help to resolve this issue..

    Attached Images Attached Images



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.34%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 11:48 PM.

Copyright BetaSoft Inc.