unable to find element..

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

unable to find element..

javelearner
Hello Selenium users... 

I have started on selenium and facing a problem... error is as following.. 

Error:::: Unable to locate element: #\/\/input\[\@id\=\'datepicker1\'\]


The line code is as following:: 
driver.findElement(By.id("//input[@id='datepicker1']")).click();

Everything seems ok to me... Can anyone please find the error in above line... 

Thanks, 
Java learner

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/30e58a38-948a-42b9-ae47-dc4cf3d91710%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: unable to find element..

abhijit apte
Try this. When you are using id as location strategy, no need to provide xpath. 


driver.findElement(By.id("datepicker1")).click();


On Sat, Apr 21, 2018, 6:45 PM <[hidden email]> wrote:
Hello Selenium users... 

I have started on selenium and facing a problem... error is as following.. 

Error:::: Unable to locate element: #\/\/input\[\@id\=\'datepicker1\'\]


The line code is as following:: 
driver.findElement(By.id("//input[@id='datepicker1']")).click();

Everything seems ok to me... Can anyone please find the error in above line... 

Thanks, 
Java learner

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/30e58a38-948a-42b9-ae47-dc4cf3d91710%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Thanks,
Abhijit Apte

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAKgOCxrT%3DrDWSWAG8S-0JOoCmMuZoAAPUk%2BqsCMvm9XwB%3DGNOQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: unable to find element..

javelearner
Thanks! I really missed that. 



On Sat, Apr 21, 2018, 11:33 PM abhijit apte <[hidden email]> wrote:
Try this. When you are using id as location strategy, no need to provide xpath. 


driver.findElement(By.id("datepicker1")).click();


On Sat, Apr 21, 2018, 6:45 PM <[hidden email]> wrote:
Hello Selenium users... 

I have started on selenium and facing a problem... error is as following.. 

Error:::: Unable to locate element: #\/\/input\[\@id\=\'datepicker1\'\]


The line code is as following:: 
driver.findElement(By.id("//input[@id='datepicker1']")).click();

Everything seems ok to me... Can anyone please find the error in above line... 

Thanks, 
Java learner

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/30e58a38-948a-42b9-ae47-dc4cf3d91710%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Thanks,
Abhijit Apte

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/UA1a114eN48/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAKgOCxrT%3DrDWSWAG8S-0JOoCmMuZoAAPUk%2BqsCMvm9XwB%3DGNOQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAPFr79b-VpvtPsEwJub2Jn5JxLvaLv7%2ByRhHOvCPDsxMQbo%2Bxg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: unable to find element..

Javed Sayyed
In reply to this post by javelearner
The syntax of clicking an element using ID should be as mentioned below.

driver.findElement(By.id("datepicke")).click();

Regards
Javed

On Apr 21, 2018 6:45 PM, <[hidden email]> wrote:
Hello Selenium users... 

I have started on selenium and facing a problem... error is as following.. 

Error:::: Unable to locate element: #\/\/input\[\@id\=\'datepicker1\'\]


The line code is as following:: 
driver.findElement(By.id("//input[@id='datepicker1']")).click();

Everything seems ok to me... Can anyone please find the error in above line... 

Thanks, 
Java learner

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/30e58a38-948a-42b9-ae47-dc4cf3d91710%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CANb5WFdi0WDrUxpkq6kQeJ7yK_FPrUp4fBPQRUhj11c-QFeWdQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.