Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to modify value in ReadOnly TextBox
#2
Not Solved
First, the reason you are getting the error is that the line:

Code:
Browser("MyPurolator Login - Purolator").Page("Purolator E-Ship Online").WebEdit(var_date).Set = "2010-12-09"

has "=" after the .Set. It should be:

Code:
Browser("MyPurolator Login - Purolator").Page("Purolator E-Ship Online").WebEdit("ServiceDate").Set "2010-12-09"

However, if the the WebEdit really is read-only, you will still get an error (just one that says that the object is disabled). If you can capture the WebTable or WebElement that represents the calendar picker when it is open, you can click a child of it with descriptive programming. For this example, assume the calendar is a WebTable called "Calendar" and the days are TDs inside the table. If this is the case you will probably have to differentiate between the "disabled" days and the "enabled" days of the month. Almost always the class attribute is different. Assume the TDs that are "enabled" have the class attribute value of "validDays" that will uniquely identify the enabled "1" as opposed to the disabled "1" at the bottom of the calendar. The Date function (as opposed to the Now function) gets today's date without time.

Code:
'Code to click the button or image that opens the calendar e.g.:
'Browser("MyPurolator Login - Purolator").Page("Purolator E-Ship Online").Image("Calendar Button Image").Click

Browser("MyPurolator Login - Purolator").Page("Purolator E-Ship Online").WebTable("Calendar").WebElement("html tag:=TD", "class:=validDays", "innertext:=" & Day(Date)).Click

Again, this code won't actually run in your test, you will have to capture the calendar and figure out what makes the enabled days different from the disabled days. I am just trying to give you an idea on how to tackle the problem.
Reply


Messages In This Thread
RE: How to modify value in ReadOnly TextBox - by cdesserich - 12-02-2010, 12:16 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [UFT] [WPF] Trigger on TextBox robertosalemi 2 1,997 05-26-2016, 07:32 PM
Last Post: robertosalemi
  Verify that a dropdown Element is in Readonly mode with QTP. nilanjans 5 6,295 07-02-2012, 08:36 PM
Last Post: nilanjans
Exclamation Record a textbox Unleash Rajesh 0 1,764 03-17-2012, 11:18 AM
Last Post: Unleash Rajesh
  modify meetings in outlook renee 2 2,753 10-14-2009, 10:26 AM
Last Post: Saket
Question validate textbox nirmal_k1231 0 2,366 05-03-2009, 09:10 PM
Last Post: nirmal_k1231

Forum Jump:


Users browsing this thread: 1 Guest(s)