Sunday, September 2, 2018

Click command in selenium webdriver does not work

Sometime in web based application, we require to click on Button or any web element present in web page, while performing automation testing with the help of selenium framework. Mostly we are preferring click() command to perform click event or operation, but sometime click command is not working for few web elements. In that case you can use sendKeys commands to perform click operation.

Click command in selenium webdriver does not work



Lets use the below line of code that might help you to perform click event on web elements :

Method-1 : 
driver.findElement(By.name("submit")).sendKeys(Keys.RETURN);


Method-2 : 
driver.findElement(By.name("submit")).sendKeys(Keys.ENTER);

NOTE : You can use sendKeys commands to perform click operation, when click command is not working.


2 comments:

  1. The article seems to be more informative. This is more helpful for our selenium training in chennai Thanks for sharing

    ReplyDelete