Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to modify value in ReadOnly TextBox
#1
Not Solved
Hello Experts,

I'm new to QTP and trying to write a Script. This script requires to change value (date) in a Readonly Textbox. I'm not sure how to accomplish this task. I've tried to set it's value with the following code but having error.

For refer here is code
-----------------------------------------------------------
Code:
Set var_date = Browser("MyPurolator Login - Purolator").Page("Purolator E-Ship Online").WebEdit("ServiceDate")
MsgBox var_date.GetTOProperty("default value")
var_date.SetTOProperty "default value", "2010-12-02"
MsgBox var_date.GetTOProperty ("default value")
Browser("MyPurolator Login - Purolator").Page("Purolator E-Ship Online").WebEdit(var_date).Set = "2010-12-09"
-----------------------------------------------------------
And Here is the Error message i'm getting when code reaches the last line.
----------------------------------------------------------
Code:
Run Error Object doesn't support this property or method: 'Browser(...).Page(...).WebEdit(...).Set'
Line (126): "Browser("MyPurolator Login - Purolator").Page("Purolator E-Ship Online").WebEdit(var_date).Set = "2010-12-09"".
----------------------------------------------------------

Some back ground on this issue as some of you might think what's the need to set value in read-only field.

The problem is it's a Calendar Field. A button is associated with it. Itself Calendar text box is read only. You click on this button beside this read-only field which shows Calendar drop down. The you choose a day number say 3, 5, 18 and so on. This Calendar read-only text field always show field by default date 1 week in advance. So user has to choose from Calendar Drop down to select today's date. I try to automate the process to click on this button and then choose the numbers(date). But the problem is these day's are 'Webelement'. Also if I start capturing them then I've to hold all 30 day's Webelements in OB. So I'm trying to come up with some way that I can use NOW() function to get today's date day and plug in this field.

For reference I've also attached a screen shot of this field and Calendar Drop down.

I hope this detail give you and others some idea. Can please someone show me how to do it?

Many thanks in advance.


Attached Files Image(s)
   
Reply


Messages In This Thread
How to modify value in ReadOnly TextBox - by zerocool - 12-01-2010, 09:00 PM

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

Forum Jump:


Users browsing this thread: 1 Guest(s)