marroth_ds
12 years agoOccasional Contributor
Chrome can't find any object
Hi,
I have a script which works on IE and Firefox, however when I do the same script using Chrome I can't find any element with the FindChild() method. The script worked before, so I don't know why it's no longer finding it. This is basically the code which is to be executed (I've omitted the function calls, validating and such):
var env = ODT.Classes.Environment;
env.m_browser = -3; //set the browser to chrome
//launches the specified browser and opens the specified URL in it.
Browsers.Item(env.m_browser).Run();
//go to the login page
Browsers.CurrentBrowser.Navigate(env.m_environmentLink);
//set user name
Aliases.browser.FindChild("idStr", "user", 9999).SetText("myuser");
...
It starts chrome, it goes to the page and...
It fails on the last one with the error message: "You are trying to call the "SetText" method or property of an object that does not exist."
Once again, this script works on both IE and Firefox (so there is nothing wrong with the parameters). I've the latest Chrome patch (32 for TC10) and im using TestComplete10 (ver 10.0.531.7)
I think that I did this piece of code before it all became like this for chrome (not sure if it's connected):
Aliases.browser.FindChild("ObjectType", "Page", 0).Refresh();
Any help as to what could be the cause or how to approach this?
I have a script which works on IE and Firefox, however when I do the same script using Chrome I can't find any element with the FindChild() method. The script worked before, so I don't know why it's no longer finding it. This is basically the code which is to be executed (I've omitted the function calls, validating and such):
var env = ODT.Classes.Environment;
env.m_browser = -3; //set the browser to chrome
//launches the specified browser and opens the specified URL in it.
Browsers.Item(env.m_browser).Run();
//go to the login page
Browsers.CurrentBrowser.Navigate(env.m_environmentLink);
//set user name
Aliases.browser.FindChild("idStr", "user", 9999).SetText("myuser");
...
It starts chrome, it goes to the page and...
It fails on the last one with the error message: "You are trying to call the "SetText" method or property of an object that does not exist."
Once again, this script works on both IE and Firefox (so there is nothing wrong with the parameters). I've the latest Chrome patch (32 for TC10) and im using TestComplete10 (ver 10.0.531.7)
I think that I did this piece of code before it all became like this for chrome (not sure if it's connected):
Aliases.browser.FindChild("ObjectType", "Page", 0).Refresh();
Any help as to what could be the cause or how to approach this?