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
4,851 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
• 58,140 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, 2020 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
661 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
• 28,040 points
456 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,980 points
3,176 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
• 58,140 points
19,851 views
0 votes
5 answers

How to use JavaScript in selenium to click an Element?

WebElement element = driver.findElement(By.id("id")); JavascriptExe ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
48,244 views
0 votes
2 answers

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,500 points
5,923 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
6,392 views
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
4,029 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 2, 2020 in Selenium by Sri
• 3,190 points
4,976 views