rlounsbury
14 years agoOccasional Contributor
Test script cannot find Alert boxes
We are working on writing TestComplete scripts to test a large web app which is in ongoing development. In the app, there are a number of areas which pop up an alert box to, for example, confirm that the user really wants to delete an entry. When I record a script, TestComplete records something like:
iexplore = Aliases.iexplore;
iexplore.dlgMessageFromWebpage.btnOK.ClickButton();
However when I run the recorded script it shows an error stating "ambiguous recognition of tested object". If I use the find method as follows:
var confirmDlg = Aliases.iexplore.Find(["MappedName"],
["*iexplore.dlgMessageFromWebpage"],
10);
confirmDlg.Wait();
var okButton = confirmDlg.Find(["MappedName"],
["*dlgMessageFromWebpage.btnOK"],
10);
okButton.Click();
The confirmDlg.Wait() line causes an "object does not exist" error. I have also tried finding the object by passing "Aliases.iexplore.dlgMessageFromWebpage" as the MappedName.
Can anyone tell me the proper way to reference this dialog so that I can access the OK button on it?
TIA,
Ron L.
iexplore = Aliases.iexplore;
iexplore.dlgMessageFromWebpage.btnOK.ClickButton();
However when I run the recorded script it shows an error stating "ambiguous recognition of tested object". If I use the find method as follows:
var confirmDlg = Aliases.iexplore.Find(["MappedName"],
["*iexplore.dlgMessageFromWebpage"],
10);
confirmDlg.Wait();
var okButton = confirmDlg.Find(["MappedName"],
["*dlgMessageFromWebpage.btnOK"],
10);
okButton.Click();
The confirmDlg.Wait() line causes an "object does not exist" error. I have also tried finding the object by passing "Aliases.iexplore.dlgMessageFromWebpage" as the MappedName.
Can anyone tell me the proper way to reference this dialog so that I can access the OK button on it?
TIA,
Ron L.