xpath check in selenium

30 views
Skip to first unread message

ia12 Imran

unread,
May 24, 2018, 7:43:21 AM5/24/18
to Selenium Users

when i find xapth in website It is correct But when I run my script  It is showing erro

AILED: ProductSearchs
java.lang.NullPointerException
    at Amazon.ProductSearch.ProductSearchs(ProductSearch.java:15)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflec


driver.findElement(By.xpath("//input[@id='twotabsearchtextbox'][@name='field-keywords']")).sendKeys("Iphone");
        driver.findElement(By.xpath("//input[@type='submit'][@value='Go']")).click();
   

Reed Xia

unread,
May 27, 2018, 10:21:03 PM5/27/18
to seleniu...@googlegroups.com
Hi,

What's code for  "at Amazon.ProductSearch.ProductSearchs(ProductSearch.java:15) "? And did you verify your xpath in browser debug tool?

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/f9be703c-d1f4-4fc9-b071-3a13edace001%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages