Selenium / Python - Selecting via css selector

0
0

Issue:

Can not select from css selector specific element. Need to verify that the registered user can change their password successfully. I have tried the different attributes of the class to call it. The result is an exception error in the method when trying with the first two examples. The final try calls the first class instance and resets the password fields (fail).

Tried:

driver.find_element_by_css_selector("value.Update").click()
driver
.find_element_by_css_selector("type.submit").click()
driver
.find_element_by_css_selector("input.test_button4").click()

Objective:

I need to select items that share the same class. As you can see below, the class is shared.

form id="changepw_form" name="changepw" action="#" method="post">
<div class="field3">
<div class="field3">
<div class="field3">
<input class="test_button4" type="reset" value="Reset" style"font-size:21px"="">
<input class="test_button4" type="submit" value="Update" style"font-size:21px"="">
  • You must to post comments
0
0
driver.find_element_by_css_selector(".test_button4[value='Update']").click()

EDIT:
Because the selector needs a class, id, or tagname, but value.Update by itself is none of these.

.test_button4 provides a classname to match against, and from there, [value='Update'] specifies which particular match(es) to select.

  • You must to post comments
Showing 1 result
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Website