Alternative of click() in selenium

0 votes
What is a better alternative of click() in selenium? Can someone help me please?
Feb 12, 2019 in Selenium by Theodore
1,425 views

2 answers to this question.

0 votes
You can use submit() method as the alternate way to click on any button, again this only can be done if the attribute type=submit.
answered Feb 13, 2019 by Priyaj
• 57,530 points
+1 vote
Depends on your scenario. webDriver click is the most reliable option. But if doesn't work you can go for sendKeys methofd using Keys.ENTER or Keys.RETURN. Sometimes above mentioned doesn't work as we can't interact with the element then we shoulp opt javascript executor click.

((JavascriptExecutor) driver).executeScript("arguments[0].click();", yourelement);
answered May 5 by Rahul

Related Questions In Selenium

+3 votes
1 answer
0 votes
1 answer

Which click command can be used to click on a specific part of webpage in Selenium?

Hi Apeksha, in Selenium IDE to click on ...READ MORE

answered Oct 17, 2019 in Selenium by Devesh
179 views
0 votes
2 answers

How can we take screenshots of tests in Selenium 2 using C#

Hey, try using following code command to ...READ MORE

answered Aug 22, 2019 in Selenium by Abha
• 27,910 points
280 views
0 votes
1 answer

Double click a record in a grid using Selenium webdriver

Try Actions class to perform this Actions action ...READ MORE

answered Mar 29, 2018 in Selenium by Damon Salvatore
• 5,540 points
1,940 views
0 votes
2 answers

Unable to Click on an Element in Selenium (Python) even after finding it.

Here, I give you working script which ...READ MORE

answered Sep 19, 2018 in Selenium by Priyaj
• 57,530 points
14,704 views
0 votes
2 answers

How to use JavaScript in selenium to click an Element?

JavascriptExecutor js = (JavascriptExecutor) driver;   js.execute ...READ MORE

answered Apr 1 in Selenium by anonymous
25,567 views
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,510 points
2,879 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,890 points
2,228 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,890 points
2,348 views