Unified Functional Testing Practitioners Forum
cancel

QTP cannot input value to Webedit field

SOLVED
Go to solution
Highlighted
Blair1000
Respected Contributor.

QTP cannot input value to Webedit field

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

8 REPLIES
Ilya Tubman
Trusted Contributor.

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"
Blair1000
Respected Contributor.

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
Krishna Kolacha
Acclaimed Contributor.
Solution

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
Blair1000
Respected Contributor.

Re: QTP cannot input value to Webedit field

Thank you Krishna,

It works !!!
QTPVineetha
Contributor.

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

Pattabiran
New Member.

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

RajkumarR
Outstanding Contributor.

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 

_____________________
Rajkumar Rajangam
UdayV473
New Member.

Re: QTP cannot input value to Webedit field

If I used WShell script(Like as suggested in salved thread) for clearing the text, it is not working  when system is locked.

Please suggest me how to overcome this problem.

 

Thanks in advance.