0

The below html code is textbox which has disabled.

How to assert in selenium python whether the textbox is disabled or enabled

1

1 Answer 1

0

As said in this post you can use is_selected() function after selecting the element in selenium.

This function returns True if it is selected.

Sign up to request clarification or add additional context in comments.

2 Comments

getting assertion error for is_selected() for the below code ownerSelect = WebDriverWait(self.driver,10).until(EC.visibility_of_element_located((By.XPATH,"(//label[starts-with(@for,'Ownerbtn')]/span[3])[1]"))) assert ownerSelect.is_selected(),"Owner box not checked" log.info("Owner box checked")
Try this way: ownerSelect = WebDriverWait(self.driver,10).until(EC.visibility_of_element_located((By.XPATH,"(//label[starts-with(@for,'Ownerbtn')]/span[3])[1]"))).is_selected()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.