Share
Go down
keithrw
Posts : 2
Join date : 2011-01-25

Validating data displayed in a read-only textfield

on Tue Jan 25, 2011 9:56 pm
Does anyone have a solution for getting the value of a textfield that has enabled=false (read-only), but is displaying either a date of last action, or 'None' for the case that the action hasn't been performed.

This is one of the final sticking points for conversion to a Selenium RC based test automation solution.

I haven't been able to find a solution on the web. WatiN gives the capability of getting the value of the textfield even if disabled.

Thoughts anyone?

Thank you

btw - VerifyValue works with Selenium IDE, but I need a solution for RC.


Last edited by keithrw on Thu Jan 27, 2011 7:40 am; edited 1 time in total (Reason for editing : more info)
avatar
Advisor
------------------------
------------------------
Posts : 383
Join date : 2009-07-30
Location : India
http://seleniumforum.forumotion.net

Re: Validating data displayed in a read-only textfield

on Fri Jan 28, 2011 7:09 pm
Hi,

you can do this with the help of storeAttribute command and firebug. with the help of firebug you can get id of the disabled text field. after that use the following command:


  • [info] Executing: |storeAttribute | text1@value | temp |
  • [info] Executing: |type | text1 | ${temp} |
Hope this will help you.Best of luck.

bye
keithrw
Posts : 2
Join date : 2011-01-25

Re: Validating data displayed in a read-only textfield

on Fri Jan 28, 2011 9:45 pm
Unfortunately, it looks like the answer given is for Selenium IDE, which works.

When you try to use .Net C# code to do the equivalent

string result = selenium.GetAttribute("txtPhoneHome@value");

you get
NightlyAutomation.ApplianceTestFF.AutomatedFFTest_UpdateManager_AvailableUpdates:
Selenium.SeleniumException : ERROR: Could not find element attribute: txtPhoneHome@value

Selenium RC is finding the element, but only using its version of the HTML to find the attribute, which does not contain a value field because of the disabled=disabled attribute (I'm attaching firebug's HTML)
<input type="text" name="PhoneHome" disabled="disabled" class="txtPhoneHome" id="txtPhoneHome">

Firebug's DOM tab however shows the needed
value: "None"

I'm not sure why Selenium RC doesn't seem to be able to expose the value attribute

Thank you,
Keith
Sponsored content

Re: Validating data displayed in a read-only textfield

Back to top
Permissions in this forum:
You cannot reply to topics in this forum