Results 1 to 3 of 3

Thread: Access an unknown object of the repository

  1. #1
    Junior Member
    Join Date
    Dec 2007
    Answers
    1

    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


  2. #2
    Expert Member
    Join Date
    Oct 2007
    Answers
    375

    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...


  3. #3

    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
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact