Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
find the property value of a run time object
#1
Not Solved
Hi All,

I am creating a runtime object like below.

Code:
Set ObjOpCoCode = Description.Create()
ObjOpCoCode("micclass").value = "Link"
ObjOpCoCode("html tag").value = "A"
ObjOpCoCode("text").value = DataTable.Value("OPCOCodeToEdit","rTD")
ObjOpCoCode("name").value = DataTable.Value("OPCOCodeToEdit","rTD")
ObjOpCoCode("hash").value = "#[0-9]{1,}"

Now I want the value of this hash at runtime. How can I do this.

I tried putting this statement
Code:
OpCoCodeId =browser("").Page("").Link(ObjOpCoCode).GetROProperty("hash")
msgbox "OpCoCodeId= "&OpCoCodeId
But the msgbox prints empty OpCoCodeId.

Does anybody have an idea?

Thanks in advance for all your help

Regards,
Reema.
Reply
#2
Not Solved
Hi reejais,

Spy on the object and check if any value is displayed for hash property for that object.

I belive there is no run time value for that property. If you notice that the run time value is not null, than correct your description object,
Code:
Set ObjOpCoCode = Description.Create()
ObjOpCoCode("micclass").value = "Link"
ObjOpCoCode("html tag").value = "A"
ObjOpCoCode("text").value = DataTable.Value("OPCOCodeToEdit","rTD")
ObjOpCoCode("name").value = DataTable.Value("OPCOCodeToEdit","rTD")


- Vinod
Reply
#3
Not Solved Wink 
Hi Reema,

Try this code:

Code:
'  Creating a child object.
Set ObjOpCoCode = Description.Create()
ObjOpCoCode("micclass").value = "Link"
ObjOpCoCode("html tag").value = "A"
ObjOpCoCode("text").value = DataTable.Value("OPCOCodeToEdit","rTD")
ObjOpCoCode("name").value = DataTable.Value("OPCOCodeToEdit","rTD")
ObjOpCoCode("hash").value = "#[0-9]{1,}"


' Making the collection object
Set OpCoCodeId =browser("").Page("").ChildObject(ObjOpCoCode)

' Doing the  count of  objects
intCount=OpCoCodeId.count

' Getting the desired property from the object
For iCnt =1 to intCount
  strHash = OpCoCodeId(iCnt).GetROProperty("hash")
  print strHash
Next

It should work.....Smile
Reply
#4
Not Solved
Hi Vinod,

There is a value displayed for hash property for that object.

eg. if OPCOCodeToEdit = TEST in external file

This TEST link has a hash property as "#1002"

Since my OPCOCodeToEdit will be changing and the hash value will be different for different OPCO Code. I do not know the value for hash property when I am creating the object. All I know is it will be something like this "#****"

Now i want to know the value of this hash at runtime.

Can I use GetROProperty with the object that I have created at runtime?

Thanks and Regards,
Reema.
Hi Ankur,

Thanks for the help.

The code is giving an "general run error" on line

Code:
strHash = OpCoCodeId(iCnt).GetROProperty("hash")

I am trying to find out meanwhile if you have an idea please let me know.

Thanks and Regards,
Reema.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  swfwindow object name getting changed after each run saniya 1 1,472 10-10-2018, 09:02 PM
Last Post: TheGlovner
  Object identification is taking too much time JACKSPARROW 0 1,586 01-17-2017, 11:08 AM
Last Post: JACKSPARROW
  [UFT] Change property of object (WpfButton) robertosalemi 2 2,485 11-22-2016, 12:43 PM
Last Post: Ankur
  QTP not recogonising object during run time Lavanya N 2 3,527 10-28-2015, 12:46 PM
Last Post: vinod123
  Writing to Run time data table Neetha 5 11,648 08-27-2015, 10:18 AM
Last Post: supputuri

Forum Jump:


Users browsing this thread: 1 Guest(s)