Forum Discussion

smaillou's avatar
smaillou
Occasional Contributor
6 years ago
Solved

Scripts does not execute properly on another PC with internet explorer 11: Need to remove IE 32 bit

Hi,

Both PC are with windows 7 pro with IE 11.

Script that I create on one PC does not execute properly on another machine.

I have discover that on the other machine I need an extra index on the web page. Sometimes not. It changes randomly

 

The first PC

Sys.Browser("iexplore").Page("http://" + IP + "/").Panel(0).Panel(1).Link(0).Click()

The second one

Sys.Browser("iexplore").Page("http://" + IP + "/", 1).Panel(0).Panel(1).Link(0).Click()

 

On the second one I have 2 process internet explorer. one 32 bit and another 64 bit.

iexplore.exe

iexplore.exe *32

 

How do I get rid of the 32 bit version??

 

Thanks. 

Help is appreciated.

  • Hi all,

     

    I have found a good workaround. Each object that I access on the web page I do a find. And this solve my issue of the page index.

      propStr  = ["namePropStr", "Visible", "VisibleOnScreen", "ObjectType"]
      valueStr = ["logout.jsp", True, True, "Link"]
      adminPageLogoutObj = Sys.Browser("iexplore").Find(propStr, valueStr,60,True)
      adminPageLogoutObj.Click()

    This way I dont have to manage IPs, page names or indexes and the code is more robust but need to write more lines.

     

    I would of like to deactivate the 32 bits version of iexplore.exe but this will suffice.

     

    Thanks for your help.

     

    Stéphane.

     

22 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Question: How are you identifying your objects in your tests?  The reason I ask...  we have that same thing with our automation... and we don't have that issue and we've made no special changes.  So, it might have something to do with your object identification and how you're referencing the browser in your code.

    • smaillou's avatar
      smaillou
      Occasional Contributor

      Hi Robert,

       

      I think it is because most the code is not using object. I use them as it is in the example above. 

       

      I guess a good work around would be to use the method find to get the object. so this way I would not have to handle the index.

       

      I can try this way but, I fear that the index, even if I use an object, will vary and I will have some failure. It seems that explorer is constantly switching between 32 and 64 bit during testing.

       

       

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        I would STRONGLY recommend that you reference all parts of your application under test using some sort of object identification, including the browser.  Please read the appropriate articles on NameMapping and consider utilizing Aliases for referencing your page object.

  • smaillou's avatar
    smaillou
    Occasional Contributor

    Hi all,

     

    I have found a good workaround. Each object that I access on the web page I do a find. And this solve my issue of the page index.

      propStr  = ["namePropStr", "Visible", "VisibleOnScreen", "ObjectType"]
      valueStr = ["logout.jsp", True, True, "Link"]
      adminPageLogoutObj = Sys.Browser("iexplore").Find(propStr, valueStr,60,True)
      adminPageLogoutObj.Click()

    This way I dont have to manage IPs, page names or indexes and the code is more robust but need to write more lines.

     

    I would of like to deactivate the 32 bits version of iexplore.exe but this will suffice.

     

    Thanks for your help.

     

    Stéphane.

     

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      Glad to here it.  I would make one change to your code, though.

       

       propStr  = ["namePropStr", "Visible", "VisibleOnScreen", "ObjectType"]
        valueStr = ["logout.jsp", True, True, "Link"]
        adminPageLogoutObj = Sys.Browser("iexplore").Find(propStr, valueStr,60,True)
      if (!adminPageLogoutObj.Exists){
        throw Error('Could not find the desired object')
      }
      adminPageLogoutObj.Click()

      This will help prevent problems where the object does not exist when you go to find it.  You should also, possibly, look into using FindEx instead of just Find because FindEx includes a WaitTime property to allow the object to render before attempting to interact with it.

      • smaillou's avatar
        smaillou
        Occasional Contributor

        Hey,

         

        Thanks for the tips. I will now use  findEx

         

        I am using a while not Exists with timeout to wait for the object. But it is a bit cumbersome just to do little thing. And I dont want to stop the script when there is an error.

         

        def verifyLoginStatus():
          Log.Enabled = False
          propStr  = ["namePropStr", "Visible", "VisibleOnScreen", "ObjectType"]
          valueStr = ["logout.jsp", True, True, "Link"]
          
          timeout = time.time() + 60 # 1 minute timeout
          while not Sys.Browser("iexplore").Find(propStr, valueStr,60,True).Exists:
            if time.time() > timeout:
              Log.Error("verifyLoginSuccess() Timeout: {:+.2f} seconds".format(time.time() - timeout).format()) 
              return FAIL 
            Log.Warning("Logout link is not ready")
            aqUtils.Delay(500)
        
          adminPageLogoutObj = Sys.Browser("iexplore").Find(propStr, valueStr,60,True)
        
          result =  aqObject.CheckProperty(adminPageLogoutObj, "contentText", cmpEqual, "Logout")  
          Log.Enabled = True
          return result