Declined
Last Updated: 22 Dec 2023 11:31 by ADMIN
ADMIN
Cody
Created on: 06 May 2014 23:41
Type: Feature Request
4
What a "Verify IsVisible" actually does is not intuitive
When a customer first sees the "Verify IsVisible" they are sort of naturally inclined to believe that Test Studio will test whether or not the target element is actually visible within the browsers window. This leads to frustration when they try to use it and it doesn't work the way they imagine it should work (see ticket 814023 for an example of this frustration).

For example, if the element is not present in the DOM, the test will actually fail with "element not found" instead of passing a test step "verify is not visible" as one would naturally expect given the incorrect assumption above. Or the test may pass indicating the element is visible when it's just hidden behind another element or scrolled out of view.

I'm not sure what the right answer is... do we change what IsVisible actually does? Do we change the name of the verification so it better reflects what it's actually verifying (which is the DISPLAY and VISIBILITY property of the element)? The current code/action is useful, once you correctly understand what it actually does.

I'm filing this just to log it so we can start discussion on how to eliminate the ambiguity of this particular verification.
3 comments
Hina
Posted on: 02 Jun 2017 17:34
I agree its gives me result as true even if the element is not present would be really misleading. would be great o have this feature
Shashi
Posted on: 08 Oct 2014 14:26
It would be really useful if Verify IsVisible returns false in the case where the element does not exist - rather than throw exceptions.  If there is a need to distinguish between the scenarios of 'element does not exist' and 'element exists but not visible', then a suitable message could be inserted into the log to indicate one or both scenarios.

a) This would enable us to use Verify IsVisible to check for both existence and visibility without the need of an additional statement - after all, an element has to exist before it can be visible.  
b) This change would also make Verify consistent with Wait for Visible which does not require the element to initially exist.

@Ryan:  I agree with you that failure message of "text didn't match" when the element was not found would be misleading.  However, I would argue that the visibility and existence are much more closely related (compared to existence and text match) and this justifies the request.  Also, my proposal to include a message in the log indicating real cause of failure may address the concern you have raised.
Melinda
Posted on: 07 May 2014 18:40
If you try to verify anything, even text, about an element that doesn't exist, the failure message is "element not found". If it said "text didn't match", you wouldn't be informed that your element wasn't available or that your identification logic was bad.