Pages

Search This Blog

Saturday, May 22, 2010

How to test element is editable in selenium

We can verify weather an element is editable or not using isEditable selenium command.

If your element is in below format

<input value="black" name="plain_text">

then we can use selenium isEditable to find this element is editable or not

assertTrue(selenium.isEditable("plain_text"));

<select name="plain_select"><option>Niraj</option></select>

assertTrue(selenium.isEditable("plain_select"));

<input disabled="yup" value="black" name="disabled_text">

assertTrue(!selenium.isEditable("disabled_text"));

<select disabled="yup" name="disabled_select"><option>Niraj</option></select>

assertTrue(!selenium.isEditable("disabled_select"));

2 comments: