How to check if a checkbox is checked and if so, uncheck it in the Selenium IDE

2

I need to test Selenium IDE with the following situation

I have a page where there are 3 columns with several lines (Field name, Status, Editable?)

In my test, I need to check if a certain field in this list has the "Editable" flag checked, and if so, I need to uncheck it to start the test

Example: My field is in the fifth line of this page, I need to scan the list until it finds it, and when it finds, check if this "Editable" check box is checked, and if it is, uncheck it. p>

Is there any way to verify this condition?

    
asked by anonymous 25.05.2016 / 14:39

1 answer

1

I think it would be easier if you had the code snippet, but see if you can understand: Gets the element, and checks to see if the selected property is "true". If it is, you click on it.

elemQueVcQuer = browser.FindElement(By.XPath(".//tr[5]/input[3]");

if (elemQueVcQuer.Selected)
{
   elemQueVcQuer.Click();
}

From what I understand you want to know just how to check if it is selected or not, right? If you need to scan the table, put it there with the code, beauty?

Embrace

    
27.05.2016 / 20:24