Unified Functional Testing (formerly QTP) News and Support Forum
Showing results for 
Search instead for 
Do you mean 

QTP cannot input value to Webedit field

SOLVED
Go to Solution
Frequent Advisor

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

1 ACCEPTED SOLUTIONS
Honored Contributor Honored Contributor

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
7 REPLIES
Advisor

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"
Frequent Advisor

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
Honored Contributor Honored Contributor

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
Frequent Advisor

Re: QTP cannot input value to Webedit field

Thank you Krishna,

It works !!!
Visitor

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

Occasional Visitor

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

Frequent Advisor

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