Forum Discussion

ameykhopade's avatar
ameykhopade
Contributor
10 years ago
Solved

i am using the FullName from object spy to execute my command but its not working if OS is changed.

Hi, 

 i am using the FullName got via object spy to execute the command and its working fine in Win 8.1 machine. but when i tried to execute the same test on my serve machine with OS as MS server 2008R2. it not working i am getting a differnt object when i spy that again on the server machine. one panel is removed from the same object.

 

Execute(strCommandLine) this is used in the frame work to execute the command.

here strCommandLine = call object name(mentioned below). method.

 

and this is what i get on the server machine 

Sys.Browser("iexplore").Page("*").Form("aspnetForm").Panel("divHeaderAndContent").Panel("contentWrapper").Panel(2).Panel(0).Panel(1).Panel(0).Textbox("ContentPlaceHolder1_txtUserName")

 

while for the same object at my local machine i am getting       Sys.Browser("iexplore").Page("*").Form("aspnetForm").Panel("divHeaderAndContent").Panel("contentWrapper").Panel(2).Panel(0).Panel(1).Panel(0).Panel(0).Textbox("ContentPlaceHolder1_txtUserName")

 

you can see that an extra Panel(0) is their.

 

any idea how to tackle  this.

  • Windows 8.1 and Windows 2008R2 are going to be using two different versions of IE 11 (assuming it's IE 11 you're working with). Essentially, this means it's possible for a page to be rendered differently on two different machines (although, not EXTREMELY likely since the versions aren't too far off).

    Suggestion: Rather than using the full path, consider using FindChild on some object in the path to locate, within the hierarchal tree of objects, the specific one you're looking for. This way, no matter what the intervening items are, you'll always find the same object.

7 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Windows 8.1 and Windows 2008R2 are going to be using two different versions of IE 11 (assuming it's IE 11 you're working with). Essentially, this means it's possible for a page to be rendered differently on two different machines (although, not EXTREMELY likely since the versions aren't too far off).

    Suggestion: Rather than using the full path, consider using FindChild on some object in the path to locate, within the hierarchal tree of objects, the specific one you're looking for. This way, no matter what the intervening items are, you'll always find the same object.

    • ameykhopade's avatar
      ameykhopade
      Contributor

      i am kinda new to this but i checked Findchild method and what i understood  is  like .

       

      parentobject =  Sys.Browser("iexplore").Page("*");

      Prpertyname = "Name";

      PropertyValue = "Textbox("ContentPlaceHolder1_txtUserName"

       

      objectName = parentobject.Findchild(Prpertyname, PropertyValue  ,1000);

       

       

      this will give me the object name and using that object name i can get the full name to call the methods .

       i will try this but am i right ?

       

       

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        It won't give you the object name, instead, it will give you the object itself so you can do whatever you need to with it.  But yes, that's the general idea.