If object equals visible then.. else.. is not working
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If object equals visible then.. else.. is not working
Hello,
I am trying to add an if else statement to check if an object is visible or not. When the object is visible everything works fine but when the object isn't visible, TestComplete keeps searching for this object and gives an error that the object is not found... Well this is the purpose.
Below you find the steps I added. To elaborate, I want to sort a list descending, but it could be possible that this option is already been done and if that's the case I don't want TestComplete to stop the test.
First I selected an onscreen object to equal the object property .visible.
Does anyone know what I am doing wrong?
Kind regards,
Luuk
Solved! Go to Solution.
- Labels:
-
Keyword Tests
-
Name Mapping
-
Test Results
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You'll want to check for the object to exist first, before you look for Visible. Use the Checking Whether an Object Exists from Scripts section in here
https://support.smartbear.com/testcomplete/docs/app-objects/common-tasks/checking-existence.html
Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
it also looks like the else statement is nested inside your if statement. you should highlight the else statement (and the following logic) and press left arrow to carry it out of the previous IF statements scope
Justin Kim
