1

I am attempting to click a save button but Selenium (with Python) is having issues. I keep getting the error, "Message: no such element: Unable to locate element"

Here is the HTML

<input type="submit" name="action[save]" class="FixedRight SPSubmitRequest button save-button disabledsubmit" value="Save">

And the XPath

//*[@id="spsisFunctionJSAutoFormID12"]/table/tbody/tr/td[3]/input

I have attempted the following to no avail

driver.find_element_by_xpath('//*[@id="spsisFunctionJSAutoFormID12"]/table/tbody/tr/td[3]/input').click()

driver.find_element_by_class_name('FixedRight SPSubmitRequest button save-button disabledsubmit" value').click()

driver.find_element_by_xpath('//button[@name='Save'].click()

None of these work and all produce the same error

0
driver.find_element_by_xpath('//*[@id="spsisFunctionJSAutoFormID12"]/table/tbody/tr/td[3]/input').click()

Without the rest of the DOM it's hard to tell what might be wrong with this one.

driver.find_element_by_class_name('FixedRight SPSubmitRequest button save-button disabledsubmit" value').click()

You accidentally copy+pasted in " value.

driver.find_element_by_xpath('//button[@name='Save'].click()

According to your snippet, the name is action[save] and the quotes are slightly off.

Try driver.find_element_by_xpath('//button[@value="Save"]').click();

1
  • Thank you for the feedback! So it ended up being that the class name was hidden for some reason. Sep 18 at 18:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.