Join 500+ Software Testing professionals. Solve problem and get your problem solved. Register Now!

0
How to click on submit button in Selenium Webdriver

Solved 1 Answers 78 Views Selenium
0 1
I have page where below is HTML of submi button.
 
<div id="submitContainer"><button type="submit" class="large"><span><strong> Create Account </strong></span></button></div>
 
As you can see, button do not have ID and its located inside div. How do I click on this button?
 
Below are few methods I have tried.
 
driver.findElement(By.id("submitContainer")).click();
 
driver.findElement(By.xpath("//*[@id='submitContainer']/button/span/strong")).click();
 
driver.findElement(By.tagName("Create Account")).click();
 
driver.findElement(By.className("large")).click();

1 Answer

1
Best answer
1

I guess below xpath should work for you.

 

//button[@type='submit']

answered by
selected by

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.
...