-
Junior Member
Access an unknown object of the repository
How to access an object of the repository not known while creating the scenario
I'd like to know if it's possible (and so how) to access an object that is not in the object repository while creating the scenario.
In my web page, I have 2 links. When I click on a button a third on is dynamically created. Then I would like to click on this new link (I know it's label and id).
Using the command: Browser("BrowserName").Page("PageName").Link("LinkName").Click
I get an error message indicating "LinkName" is not present in the object repository.
ThanKS
-
Expert Member
Re: Access an unknown object of the repository
Hi,
Since your third link is created dynamically, it would not be a part of Object Repository. Hence please use Descriptive Programming.
Check this for Instance -
Set obj_Desc = Description.Create
obj_Desc(“html tag”).value= “INPUT”
obj_Desc(“name”).value= “txtUser”
Once done use the Obj_Desc in your code as follows -
Browser(“Browser”).Page(“Page”).WebEdit(obj_Desc).set “Test”
Based on the above, specify the html tag and name values for the link that appears dynamically.
Cheers...
-
Moderator
Re: Access an unknown object of the repository
If you follow what bizzzzzare said, you can define all your objects without having to ever use OR. You can define objects in one place (Ex: obj_Desc in the previous post) and call them whenever you need them.
You can try using this. Let me know if it fails to work:
wait(2)
Browser("micClass:=Browser").Page("micClass:=Page").Frame("name:=frameName").Link("name:=linkName").Click
If your application doesn't use frames, remove the FrameObj from the above code. Use Object Spy, find the name of the link and replace that with "linkName"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules