Note that there are some explanatory texts on larger screens.

plurals
  1. POXPATH and CSS locators throws error for Chrome in webdriver
    primarykey
    data
    text
    <p>I am facing issues in locating element in chrome. XPath of the element looks this way:</p> <pre><code>//*[@id="signin"] (right click on the element and copy xpath) </code></pre> <p>CSS for the same:</p> <pre><code>$$("div[id='signin']") </code></pre> <p>Now I am able to locate the element in chrome when I hover over them manually. But when I try to implement the same as code it throws error.</p> <pre><code>driver.findElement(By.cssSelector("$$("div[id='signin']")).click(); - CSS driver.findElement(By.xpath("//*[@id="signin"]")).click(); - XPATH </code></pre> <p>It throws <code>remove argument to match 'xpath(String)'</code> Help!!</p> <p><strong>Code :</strong></p> <pre><code>public static WebDriver driver; @BeforeClass public static void start() { File file = new File("D:/new/chromedriver.exe"); System.setProperty("webdriver.chrome.driver", file.getAbsolutePath()); driver = new ChromeDriver(); driver.get("http://abcd.com"); } @AfterClass public static void close() { driver.close(); } @Test public static void test() { driver.findElement(By.name("UserId")).sendKeys("100"); driver.findElement(By.name("Password")).sendKeys("100"); driver.findElement(By.xpath("//*[@id='signin']")).click(); } } </code></pre> <p><strong>@NOte : the URL here is dummy. in the real time am using a proper URL. It throws the below error</strong></p> <blockquote> <p>FAILED: test org.openqa.selenium.NoSuchElementException: The element could not be found (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 89 milliseconds For documentation on this error, please visit: <a href="http://seleniumhq.org/exceptions/no_such_element.html" rel="nofollow">http://seleniumhq.org/exceptions/no_such_element.html</a> Build info: version: '2.32.0', revision: '6c40c18', time: '2013-04-09 17:23:22' System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0'</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload