d4h8a1
14 years agoNew Contributor
Conditional if statements do not seem conditional
Hello folks. I have had only a few weeks time to play with TestComplete, but I am an experienced C programmer with a little java exposure.
When I test this program I get one of these three dialog boxes randomly. Currently I am trying to use this code to click whichever button shows up to make the box go away. When the script runs it gets to the first if statement, gives and error that no object was found, but still tries to click the button like there was a button visible on the screen. For the life of me I cannot figure out why.
while(1) {
if(BtnConfirmOverWriteYes.VisibleOnScreen()) {
BtnConfirmOverWriteYes.ClickButton();
break;
}
if(BtnConfirmOverWriteSiteOK.VisibleOnScreen()) {
BtnConfirmOverWriteSiteOK.ClickButton();
break;
}
if(BtnNumberingDifferencesRetreive.VisibleOnScreen()) {
BtnNumberingDifferencesRetreive.ClickButton();
break;
}
}
I am writing this script in JavaScript. I think.
Thanks for the help,
Eric