Micro Focus QTP (UFT) Forums
Help on - Handle Runtime object in QTP - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Help on - Handle Runtime object in QTP (/Thread-Help-on-Handle-Runtime-object-in-QTP)



Help on - Handle Runtime object in QTP - geom - 11-15-2010

I have a .net page which have runtime generated webedit fields.Actually i don't know anything about it before running the application.I need to change the value of these runtime webedit field.
I tried to use this code,but shows error object not registered.

Code:
Set Desc = Description.Create()
Desc("micclass").Value = "WebEdit"
Set Edits = Browser("Repsmart Data Centre").Page("RDC Product").Frame("popupFrame_3").ChildObjects(Desc)
MsgBox "Number of Edits: " & Edits.Count
Max = Edits.Count -1

For x = 1 to Max

detail=Edits(x).GetROProperty("Name")
Browser("Repsmart Data Centre").Page("RDC Product").Frame("popupFrame_3").WebEdit(detail).Set "17.50"

next



RE: Help on - Handle Runtime object in QTP - KavitaPriyaCR - 11-15-2010

Hi
sorry Saket...As i am not able to post reply in tag...here i am replying the post in independent tag.

1. There may be multiple webedits in that screen, so you have to provide additional property.
AND/OR
2. Try the script for loop as:
Code:
For x = 1 to Max
  Edits(x).Set "17.50"
next
Set Desc = Description.Create()
Desc("micclass").Value = "WebEdit"
Set Edits = Browser("Repsmart Data Centre").Page("RDC Product").Frame("popupFrame_3").ChildObjects(Desc)
MsgBox "Number of Edits: " & Edits.Count
Max = Edits.Count -1
For x = 1 to Max
  Edits(x).Set "17.50"
next



RE: Help on - Handle Runtime object in QTP - rajeshwar - 11-15-2010

Hi,

Here you are fetching the Name property of an WebEdit but the way you are passing it is Not correct.

Please Replace
Code:
Browser("Repsmart Data Centre").Page("RDC Product").Frame("popupFrame_3").WebEdit(detail).Set "17.50"

By
Code:
Browser("Repsmart Data Centre").Page("RDC Product").Frame("popupFrame_3").WebEdit("Name:="&detail).Set "17.50"

and Try.

If possible please attach a snapshot.


RE: Help on - Handle Runtime object in QTP - geom - 11-16-2010

Thanks kavita.This code worked fine.Thanks for all members who tried to reply and help me.