Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

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

Validating data displayed in a read-only textfield Empty Validating data displayed in a read-only textfield

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)
Advisor
Advisor
------------------------
------------------------
Posts : 387
Join date : 2009-07-30
Location : India
https://seleniumforum.forumotion.net

Validating data displayed in a read-only textfield Empty Re: Validating data displayed in a read-only textfield

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
avatar
keithrw
Posts : 2
Join date : 2011-01-25

Validating data displayed in a read-only textfield Empty Re: Validating data displayed in a read-only textfield

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

Validating data displayed in a read-only textfield Empty Re: Validating data displayed in a read-only textfield

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