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
• 760 points
2,383 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
1,768 views
0 votes
2 answers
0 votes
1 answer

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

Hi Nilaabh, Selenium Webdriver uses findElement and ...READ MORE

answered May 8, 2019 in Selenium by Anvi
• 14,010 points
1,083 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
2,898 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
1,537 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,850 points
1,484 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,850 points
1,262 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
11,184 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
2,010 views