0

i am trying to inspect an element . When i right click and inspect that element i see the below things

Screenshot1

Screenshot2

I tried below but it didn't worked for me

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

Can someone please help me here.

puchu
  • 69
  • 1
  • 9
  • 1
    What do you mean didn't work?? Is there any exception or something else?? – Saurabh Gaur Oct 21 '16 at 03:15
  • Check if there any frame in your webpage. If yes, please switch to the frame first and then try. http://stackoverflow.com/questions/9942928/how-to-handle-iframe-in-webdriver – Solomon Raja Oct 21 '16 at 04:19

1 Answers1

0

It's possible the web page is not loading completely when the click() executes, so it won't be able to find what it is supposed to click on. You may need to sleep the script for a couple seconds.

Otherwise, take a look at this link:

How to click an element in Selenium WebDriver using JavaScript

Community
  • 1
  • 1
rgon91
  • 26
  • 1