Ask a Question

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

SOLVED
smaillou
Occasional Contributor

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.

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


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
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
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.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
smaillou
Occasional Contributor

Is that you are saying?

Still has not resolved my issues. Still have error executing on second pc

I am new to testcomplete.

 

def t():
IP = "10.37.85.16"
Log.Message("iCAdminLogin to " + IP)

Browsers.Item[btIExplorer].Navigate("http://" + IP + "/")

pageObj = Sys.Browser("iexplore").Find("LocationURL", "http://10.37.85.16/")
pageObj.Panel(0).Panel(1).Link(0).Click()

loginPageObj = Sys.Browser("iexplore").Find("LocationURL", "http://10.37.85.16/SystemTools/login.jsp")
loginPageObj.Wait()
loginPageObj.Panel(0).Panel(2).Form(0).Table(0).Cell(0, 1).Textbox("username").Click(46, 10)
loginPageObj.Panel(0).Panel(2).Form(0).Table(0).Cell(0, 1).Textbox("username").SetText("admin")
loginPageObj.Panel(0).Panel(2).Form(0).Table(0).Cell(0, 1).Textbox("username").Keys("[Tab]")
loginPageObj.Panel(0).Panel(2).Form(0).Table(0).Cell(1, 1).PasswordBox("password").SetText("icontrol")
loginPageObj.Panel(0).Panel(2).Form(0).Table(0).Cell(1, 1).PasswordBox("password").Keys("[Enter]")
loginPageObj.Wait()

Log.Enabled = False
adminPageObj = Sys.Browser("iexplore").Find("LocationURL", "http://10.37.85.16/SystemTools/admin.jsp")
result = aqObject.CheckProperty(adminPageObj.Panel(0).Panel(1).Link(0), "contentText", cmpEqual, "Logout")
Log.Enabled = True

adminPageObj.Panel(0).Panel(1).Link(0).Click()

return result

tristaanogre
Esteemed Contributor

Please read https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/over... This is the preferred way of identifying objects in TestComplete.  It will make managing your objects so much easier.  What you have written will work... but as you noted, it doesn't necessarily work 100% of the time because of the variabiltiy of the OS.



Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
smaillou
Occasional Contributor

ok even when I use the find method I get wrong index.

 

Using the find Method when I look in the obj I get 

Page("http://10.38.85.16/")

When I look in object browser I get

Page("http://10.38.85.16/",1)

 

I still get an index issue

Now, I'm no Python dude... but if you're not going to use NameMapping, at least leverage what TestComplete gives you.

Change your code as follows:

def t():
IP = "10.37.85.16"
Log.Message("iCAdminLogin to " + IP)

browser = Browsers.Item[btIExplorer].Run();
browser.Navigate("http://" + IP + "/");

pageObj = browser.Find("LocationURL", "http://10.37.85.16/")
pageObj.Panel(0).Panel(1).Link(0).Click()

loginPageObj = browser.Find("LocationURL", "http://10.37.85.16/SystemTools/login.jsp")
loginPageObj.Wait()
loginPageObj.Panel(0).Panel(2).Form(0).Table(0).Cell(0, 1).Textbox("username").Click(46, 10)
loginPageObj.Panel(0).Panel(2).Form(0).Table(0).Cell(0, 1).Textbox("username").SetText("admin")
loginPageObj.Panel(0).Panel(2).Form(0).Table(0).Cell(0, 1).Textbox("username").Keys("[Tab]")
loginPageObj.Panel(0).Panel(2).Form(0).Table(0).Cell(1, 1).PasswordBox("password").SetText("icontrol")
loginPageObj.Panel(0).Panel(2).Form(0).Table(0).Cell(1, 1).PasswordBox("password").Keys("[Enter]")
loginPageObj.Wait()

Log.Enabled = False
adminPageObj = browser.Find("LocationURL", "http://10.37.85.16/SystemTools/admin.jsp")
result = aqObject.CheckProperty(adminPageObj.Panel(0).Panel(1).Link(0), "contentText", cmpEqual, "Logout")
Log.Enabled = True

adminPageObj.Panel(0).Panel(1).Link(0).Click()

return result

Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
smaillou
Occasional Contributor

Would name mapping solve my index issue?

 

Here they dont like to use name mapping.

tristaanogre
Esteemed Contributor

Yes, I think NameMapping will solve your issue... and if they are making you use TestComplete as the tool, they really should consider using NameMapping since that is a central piece of TestComplete for interacting with the objects of the application under test.  

 

As for your other question about "Find"... there are 2 copies of the page out there...  Find will return one of the two, specifically, it will find from "bottom up".  So, the one with Index 1 is the one that is found. 

 

Technically speaking, for the page, you don't need "Find".  The page is the first child of the browser object.  So, if you have the browser using the Browser.Run method that I noted, all you have to do is reference the page as 

 

browser.Page(url); where URL is the URL for the page you want to interact with.

 

But really... NameMapping and better object identification is going to be key to successfully using TestComplete.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
cancel
Showing results for 
Search instead for 
Did you mean: