This Question is Possibly Answered

1 "correct" answer available (4 pts) 2 "helpful" answers available (2 pts)
6 Replies Last post: Jul 1, 2009 8:54 AM by anilkumarch  
Ritu Beginner 3 posts since
Jun 30, 2009
Currently Being Moderated

Jun 30, 2009 8:43 AM

Assert/Verify a field with value as readOnly

Hi,

 

I'm a newbee and trying to use Selenium IDE to record my web appliction tests.

Could you help me with the assert text command, I have a field with value in it but that is readOnly.What will be the syntax to verify the value and also to ascertain that the field is readonly.

 

Many thanks

RKa

Santiago Suarez Ordoñez Almighty 998 posts since
Aug 7, 2008
Currently Being Moderated
2. Jul 1, 2009 8:07 AM in response to: Ritu
Re: Assert/Verify a field with value as readOnly

Could you paste the html code of that field (with a couple of lines

above and bellow it).

Santiago Suarez Ordoñez Almighty 998 posts since
Aug 7, 2008
Currently Being Moderated
4. Jul 1, 2009 8:51 AM in response to: Ritu
Re: Assert/Verify a field with value as readOnly

Readonly is only for input fields, tables are to present content, not

to receive. Sometimes certain interfaces emulate that using

javascript, tables and CSS, but the way they work is complex.

 

Is your AUT in a public domain? If not, could you paste the sourcecode

of the page?

anilkumarch Beginner 40 posts since
Jun 3, 2009
Currently Being Moderated
5. Jul 1, 2009 8:52 AM in response to: Ritu
Re: Assert/Verify a field with value as readOnly

Hi Ritu,

 

Try with the below code:

<tr>

<td>assertValue</td>
<td>mct_days</td>               // Give the textfield name.
<td>exact:09:00</td>

</tr>

 

or

 

<tr>

<td>assertValue</td>

  <td>//table[@id='mct_days']/tbody/tr[2]/td[3]</td>

<td>exact:09:00</td>

</tr>

anilkumarch Beginner 40 posts since
Jun 3, 2009
Currently Being Moderated
6. Jul 1, 2009 8:54 AM in response to: Ritu
Re: Assert/Verify a field with value as readOnly

U can use 'assertEditable' to verify it is editable or not.

 

assertEditable(locator)
Generated from isEditable(locator)
Arguments:
Returns:
true if the input element is editable, false otherwise
Determines whether the specified input element is editable, ie hasn't been disabled. This method will fail if the specified element isn't an input element.

More Like This

  • Retrieving data ...