How to submit a form in Selenium webdriver if submit button can't be identified?

0 votes
How to submit a form in Selenium webdriver if submit button can't be identified?
Jul 8, 2019 in Selenium by Deepa
4,036 views

1 answer to this question.

0 votes

Hey Deepa, if you want to submit a form on a webpage and submit button can't be identified, then in that case you can use any element of the form to submit it. Selenium webdriver find the form for us from the web element and then you can use that element to submit the form. Below is an example for it:

//Enter username
driver.findElement(By.id("username")).sendKeys("rajan.sharma@gmail.com");

//Enter password
driver.findElement(By.id("password")).sendKeys("password123");

//submit form
driver.findElement(By.id("password")).submit();

/* In this piece of code, id of password input box is used to identify a form. */
answered Jul 8, 2019 by Rajan

Related Questions In Selenium

0 votes
1 answer

How to automate radio button and checkbox on a webpage in Selenium Webdriver?

Hey Yashmita, following code snippet automates the ...READ MORE

answered Jul 22, 2019 in Selenium by Anvi
• 14,050 points
680 views
0 votes
3 answers

How to specify "ENTER" button functionality in Selenium WebDriver code?

using OpenQA.Selenium.Interactions; Actions builder = new Actions(driver); ...READ MORE

answered Feb 12, 2019 in Selenium by anonymous
28,836 views
0 votes
1 answer
0 votes
1 answer

How to open a browser window in full screen using Selenium WebDriver with C#

Simply Use this: driver.Manage().Window.Maximize(); READ MORE

answered Jun 7, 2018 in Selenium by Samarpit
• 5,870 points
7,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,613 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,870 points
2,057 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,870 points
2,168 views
0 votes
5 answers
0 votes
1 answer