Assert/Verify a field with value as readOnly

614 views
Skip to first unread message

Ritu

unread,
Jun 30, 2009, 9:43:52 AM6/30/09
to selenium-users...@googlegroups.com
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

Ritu

unread,
Jul 1, 2009, 4:41:07 AM7/1/09
to selenium-users...@googlegroups.com
Also to add to the above the field is getting populated with a value from some other page. So its not an input field.
but a readonly table field with value in it. How can I get Selenium IDE to assert/verify that field value and to ensure that it is readonly.

Thanks
Ritu

Ritu

unread,
Jul 1, 2009, 9:34:21 AM7/1/09
to selenium-users...@googlegroups.com
Hi Santiago,

The code is below

table id="mct_days" cellspacing="1" cellpadding="3" border="0" width="100%">
!null|class=twisty!<tbody>!null|class=twisty!<tr class="multi_column_header_row"></tr>!null|class=twisty!<tr class="multi_column_row">!null|class=twisty!<td class="textelevenpix" nowrap="" style="background-color: rgb(245, 245, 245);"></td>!null|class=twisty!<td class="textelevenpix" nowrap="" style="background-color: rgb(245, 245, 245);"></td>!null|class=twisty!<td class="textelevenpix" nowrap="" style="background-color: rgb(245, 245, 245);"><div id="scheduled_from_1" class="texttwelvepixinline" name="scheduled_from_1"> 09:00</div></td>!null|class=twisty!<td class="textelevenpix" nowrap="" style="background-color: rgb(245, 245, 245);"></td>!null|class=twisty!<td class="textelevenpix" nowrap="" style="background-color: rgb(245, 245, 245);"></td>!null|class=twisty!<td class="textelevenpix" nowrap="" style="background-color: rgb(245, 245, 245);"></td>!null|class=twisty!<td class="textelevenpix" nowrap="" style="background-color: rgb(245, 245, 245);"></td>!null|class=twisty!<td class="textelevenpix" nowrap="" style="background-color: rgb(245, 245, 245);"></td></tr>

This is what I'm trying to do,

!#!
<tr>\\ &nbsp;&nbsp;&nbsp; <td>assertText</td>\\ &nbsp;&nbsp;&nbsp; <td>//table[@id='mct_days']/tbody/tr[2]/td[3]</td>\\ &nbsp;&nbsp;&nbsp; <td>exact:09:00</td>\\ </tr>

And I want to now is, how to ensure that this particular field is Readonly.

!#!
!#!
!#!!#!
I'm unable to copy the picture here as it says am not authorised to do it on this website.

Please tell me if you need more details, I'll be happy to provide that.

Many thanks
Ritu

anilkumarch

unread,
Jul 1, 2009, 9:52:14 AM7/1/09
to selenium-users...@googlegroups.com
Hi Ritu,

Try with the below code:
<tr>
<td>assertValue</td>\\ <td>mct_days</td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Give the textfield name.\\ <td>exact:09:00</td>
</tr>

or

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

anilkumarch

unread,
Jul 1, 2009, 9:54:58 AM7/1/09
to selenium-users...@googlegroups.com
U can use 'assertEditable' to verify it is editable or not.

*assertEditable(locator)*Generated from *isEditable(locator)*Arguments:* locator - an [element locator]
Returns:true if the input element is editable, false otherwiseDetermines 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.
Reply all
Reply to author
Forward
0 new messages