Chris
Chris

Reputation: 1421

Trouble clicking submit button in selenium

I am trying to click the submit button in the login page for my router, but am having trouble doing so.

Here is a screenshot of the login page: screenshot

I know I need to do some sort of driver.find_element_by_something(), but cannot figure out what to call it on.

here is what I use to fill in the forms

driver.get("http://172.18.40.177:8080/index.html")
username = driver.find_element_by_name("userid2")
username.send_keys("admin")

password = driver.find_element_by_name("passwd2")
password.send_keys("cyber")

html webpage

Upvotes: 0

Views: 54

Answers (1)

chris-crush-code
chris-crush-code

Reputation: 1149

without your code and seeing the rest of the html it's hard to say. something like the below will probably work

driver.find_element_by_xpath("descendant::tr/td/img").Click();

the thing is if there's other img tags within a td it may find those first. In that case you'll have to do some analysis on the html to figure out a way to select the button but xpath is likely your best bet.

Upvotes: 1

Related Questions