QTP cannot input value to Webedit field (2350 Views)
Reply
Frequent Advisor
Blair1000
Posts: 59
Registered: ‎04-16-2008
Message 1 of 8 (2,350 Views)
Accepted Solution

QTP cannot input value to Webedit field

[ Edited ]

Hi All,

Go to www.dhl..ca

Select "Rate " and then select "Rate Calculator "

input "E4V4T7" in Ship From Postal/Zip Code: field

Browser("Rates" ).Page("Rates" ).WebEdit( "WebEdit" ).Set "E4V4T7"

The object repository can identify this object, but QTP cannot
input "E4V4T7" in the Postal/Zip Code: field when I playback

Could you tell me why QTP cannot input value in this field?

Thank you

 

 

P.S. This thread has been moved from Quality Center Support and News Forum to Unified Functional Testing (formerly QTP) News and Support Forum. -HP Forum Moderator

Please use plain text.
Advisor
Ilya Tubman
Posts: 23
Registered: ‎03-04-2008
Message 2 of 8 (2,350 Views)

Re: QTP cannot input value to Webedit field

Hi
i don't have access to this URL but try
Browser("Rates" ).Page("Rates" ).WebEdit( "WebEdit" ).Type "E4V4T7"
Please use plain text.
Frequent Advisor
Blair1000
Posts: 59
Registered: ‎04-16-2008
Message 3 of 8 (2,350 Views)

Re: QTP cannot input value to Webedit field

The object does not support the method "WebEdit("WebEdit").Type

The url is http://www.dhl.ca/ca/wfRateCalculator.aspx
Please use plain text.
Honored Contributor
Krishna Kolachalama
Posts: 648
Registered: ‎01-29-2008
Message 4 of 8 (2,350 Views)

Re: QTP cannot input value to Webedit field

Try this:
Set WshShell = CreateObject("WScript.Shell")
Browser("Rates").Page("Rates").WebEdit("WebEdit").Click
WshShell.SendKeys("E4V4T7")
Set WshShell = Nothing
Wait 2
Please use plain text.
Frequent Advisor
Blair1000
Posts: 59
Registered: ‎04-16-2008
Message 5 of 8 (2,350 Views)

Re: QTP cannot input value to Webedit field

Thank you Krishna,

It works !!!
Please use plain text.
Occasional Visitor
QTPVineetha
Posts: 2
Registered: ‎02-10-2014
Message 6 of 8 (1,569 Views)

Re: QTP cannot input value to Webedit field

My application is a Siebel app. I am unable to set text using .set and also the below piece of code. pls help

 

Set ObjBroAdministration = Browser("brEPOSAdministration").Page("pgEPOSAdministration")
Set WshShell = CreateObject("WScript.Shell")
vname = "_id130:programid"
ObjBroAdministration.WebEdit("name:="&vname).click
WshShell.SendKeys("E4V4T7")
Set WshShell = Nothing
Wait 2

 

Attached screenshot ofthe object hierarchy

Please use plain text.
Occasional Visitor
Pattabiran
Posts: 1
Registered: ‎02-28-2014
Message 7 of 8 (1,452 Views)

Re: QTP cannot input value to Webedit field

Try this...

 

 

Set ObjBroAdministration = Browser("brEPOSAdministration").Page("pgEPOSAdministration")
Set WshShell = CreateObject("WScript.Shell")
Set oWebEdit = Description.Create
oWebEdit("html tag").value= "INPUT"
oWebEdit("name").value= ".*programid"
ObjBroAdministration.WebEdit(oWebEdit).click 15.5
WshShell.SendKeys("E4V4T7")
Set WshShell = Nothing
Wait 2

Please use plain text.
Frequent Visitor
Raj_Raj
Posts: 3
Registered: ‎04-22-2013
Message 8 of 8 (1,435 Views)

Re: QTP cannot input value to Webedit field

Reasons why there is failure when entering text in WebEdit.

 

1. There is a Sync Issue.

      Data is entered even before the page is fully loaded (or) WebEdit field is refreshed based on another field & hence the data is wiped out on page/field load.

            

2. It's related to the Replay Type.

     By default QTP/UFT uses the 'Event' replay type. When QTP sets the value with this replay type, it doesn't fire the associated events in the WebEdit. 

 

To Debug:

 

Insert a Break point before & after the Set statement to see what's happening. Based on what you find, you could handle it using Sync statements or by changing the replay type.

 

Changing the replay type

'For Mouse Replay type
Setting.WebPackage("ReplayType")=2

 

 .Set "Data"

 

'For Event Replay type
Setting.WebPackage("ReplayType")=1 

Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation