Forum Discussion
Do you click ok to get the alert box to go away before going back to the check boxes?
If not, you need to do that first to get TestComplete to focus properly.
If you are, then try either putting a delay between clicking on the alert box and looking for the check box, or using Set Focus on the check box before looking for the state (or try both!).
- AlexKaras10 years agoChampion Level 3
Hi,
It is my guess that the following occurs:
-- TestComplete clicks the checkbox for the default language to clear (unselect) it;
-- Some JScript code attached to the OnStateChange/OnClick/etc. event for the checkbox on the web page detects that the check box cannot be cleared, selects it again and displays the warning message;
-- TestComplete detects that the checkbox was clicked successfully but its state did not change and posts an error to the log.
If the above sounds reasonable for the given case, I would try not to click the checkbox, but to set a focus to it and emulate pressing the Space key (which should uncheck the checkbox). Something like oChkBox.Keys(" "). .Keys() method just sends corresponding key code(s) to the message queue and does not perform any additional verifications, so this should not post any error to the test log and you should be able to check if the warning message was shown or not.
- Blur10 years agoContributor
Yes, it is closer to the scenario you have provided. The language box is already defaulted. When I proceed to uncheck the box, an alert message appears which tells me that a default language has to be selected. In which the checkbox will then be left checked. However, testcomplete gets confused because it does not seem to notice that the box was left in the checked state. This throws back an error. I am working strictly with keyword testing but willing to give anything a try. Thanks.Edit:
First, I was wondering if we can delete posts. I am new to this forum and double posted.
Next. The space key does in fact uncheck the box but it functions just like a left-click. The alert still comes up in which makes it so testcomplete is unable to find the value. Is there a way to check/uncheck boxes while ignoring the values?
- Blur10 years agoContributor
Yes, when I am recording the keyword tests, I am able to get the alert box to go away by pressing ok. However, the software testcomplete, is unable to see that the checkbox remained untouched because the alert box popped up.
- Blur10 years agoContributor
Hello,
Neither of the suggested solutions worked for me. I was wondering if I could use the WaitProperty method to fix this. I'm not too familiar with WaitProperty but my idea is just to somehow delay the ClickChecked operation until I press "OK" from the alertbox.
Related Content
- 2 years ago
- 2 years ago
- 4 years ago
Recent Discussions
- 19 hours ago
- 2 days ago