Search
 
 

Display results as :
 


Rechercher Advanced Search

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Validating data displayed in a read-only textfield

View previous topic View next topic Go down

Validating data displayed in a read-only textfield

Post by keithrw 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)

keithrw

Posts : 2
Join date : 2011-01-25

Back to top Go down

Re: Validating data displayed in a read-only textfield

Post by Adviser 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

Adviser
------------------------
------------------------

Posts : 379
Join date : 2009-07-30
Location : India

http://seleniumforum.forumotion.net

Back to top Go down

Re: Validating data displayed in a read-only textfield

Post by keithrw 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

keithrw

Posts : 2
Join date : 2011-01-25

Back to top Go down

Re: Validating data displayed in a read-only textfield

Post by Sponsored content Today at 7:28 pm


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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