Difference between submit vs click in Selenium Webdriver

0 votes
When testing forms, we can use either submit() or click() according to Selenium documentation. But when I use click(), the form submission hangs. Is there any diference that I should be aware of? Atleast logically because one of them is not working.
May 24, 2018 in Selenium by eLiJha
• 770 points
4,915 views

1 answer to this question.

0 votes
The submit() function is specifically for forms and makes things simpler. It can be used inside forms on elements, or form tags to submit that form.
Or else the obvious way is to use click() function after searching for that submit button.

So the only difference being: click() should be done on submit button and submit() can be done anywhere on the form element. The choice is yours.
http://docs.seleniumhq.org/docs/03_webdriver.jsp#user-input-filling-in-forms
answered May 24, 2018 by sniffy_god
• 780 points

Related Questions In Selenium

0 votes
1 answer

Differences between Implicit wait Vs. Explicit wait in selenium webdriver

Implicit Wait - It instructs the web driver ...READ MORE

answered Apr 9, 2018 in Selenium by ghost
• 1,790 points
2,687 views
0 votes
2 answers
+1 vote
2 answers

What is the difference between findElement and findElements in Selenium Webdriver?

FindElement Command -This method locates for the ...READ MORE

answered Feb 10, 2020 in Selenium by anonymous
3,288 views
0 votes
1 answer

What is the difference between WebDriver and RemoteWebdriver in Selenium?

Hey Ishan, the difference between Webdriver and ...READ MORE

answered May 10, 2019 in Selenium by Pratibha
• 3,690 points
7,598 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,520 points
4,346 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,010 points
5,266 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
3,146 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,010 points
3,666 views
+1 vote
2 answers

Is it possible to scroll down in a webpage using selenium webdriver programmed on python?

I using next code for facebook for ...READ MORE

answered May 16, 2019 in Selenium by mslavikas@gmail.com
20,216 views
0 votes
2 answers

When executing my Jenkins tests with Selenium WebDriver, I do not see a GUI.

Hi eLiJha, I also faced the same issue ...READ MORE

answered Jul 15, 2019 in Selenium by nayan
• 160 points
6,382 views