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 in Selenium by Deepa
94 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 by Rajan

Related Questions In Selenium

0 votes
1 answer
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 in Selenium by anonymous
8,967 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,130 points
3,383 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,090 points
589 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,130 points
898 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,130 points
575 views
0 votes
5 answers