How is "wait for visible" calculated?

7 posts, 0 answers
  1. David
    David avatar
    25 posts
    Member since:
    May 2012

    Posted 21 Dec 2012 Link to this post

    We had a test fail last night, a wait for visible check which used to pass reliably stopped working.  The issue doesn't appear to be timing related, the failure is now very repeatable.  It is confusing because the button visually doesn't look any different today than yesterday - it is very visible.

    Using the Test Studio tools, I don't see any style specific information - if I use IE developer tools, there *may* be a difference in the styles, but it is really difficult to tell, nothing obvious pops out.

    Can anybody offer tips on how Test Studio calculates the "visible" check?  Checking for visible is something we tend to use a lot to pace the tests.
  2. David
    David avatar
    25 posts
    Member since:
    May 2012

    Posted 21 Dec 2012 Link to this post

    Here is an excerpt from a log that really has me wondering about this, look at the times:

    Overall Result: Pass
    ------------------------------------------------------------
    '12/21/2012 9:14:00 AM' - Enabling Html Popup Tracker. Test expecting Popups.
    '12/21/2012 9:14:00 AM' - Using 'InternetExplorer' version '9.0' as default browser.
    '12/21/2012 9:14:02 AM' - 'Pass' : 1. Wait for 'ShowDataButton' is enabled
    '12/21/2012 9:14:24 AM' - 'Pass' : 2. Wait for element 'ShowDataButton' 'is' visible.
    '12/21/2012 9:14:25 AM' - 'Pass' : 3. Wait for 'MyReportsImage' is enabled
    '12/21/2012 9:14:35 AM' - 'Pass' : 4. Wait for element 'MyReportsImage' 'is' visible.
    '12/21/2012 9:14:37 AM' - 'Pass' : 5. Click 'MyReportsImage'
    '12/21/2012 9:14:53 AM' - 'Pass' : 6. Wait for element 'Create' 'is' visible.
    ------------------------------------------------------------
    '12/21/2012 9:14:53 AM' - Overall Result: Pass
    '12/21/2012 9:14:53 AM' - Duration: [0 min: 53 sec: 362 msec]
    ------------------------------------------------------------

    We first check if an element is enabled, very quick - then check to see it is visible.  The same element with no actions taken on page take a long time to calculate the visible check.

    Is there a better way to pace the tests?  We have found that in most situations, wait for exist is not enough.
  3. David
    David avatar
    25 posts
    Member since:
    May 2012

    Posted 21 Dec 2012 Link to this post

    Even more information...same target system, same section of the test, but run with NO execution delay executes much, much faster.  Yes, I would expect it to run faster without a delay, but 200 ms delay between steps should not account for so much time;  6 steps go from 53 seconds to 4 seconds just by removing the 200 ms delay?

    Overall Result: Pass
    ------------------------------------------------------------
    '12/21/2012 11:23:00 AM' - Enabling Html Popup Tracker. Test expecting Popups.
    '12/21/2012 11:23:00 AM' - Using 'InternetExplorer' version '9.0' as default browser.
    '12/21/2012 11:23:02 AM' - 'Pass' : 1. Wait for 'ShowDataButton' is enabled
    '12/21/2012 11:23:03 AM' - 'Pass' : 2. Wait for element 'ShowDataButton' 'is' visible.
    '12/21/2012 11:23:03 AM' - 'Pass' : 3. Wait for 'MyReportsImage' is enabled
    '12/21/2012 11:23:04 AM' - 'Pass' : 4. Wait for element 'MyReportsImage' 'is' visible.
    '12/21/2012 11:23:04 AM' - 'Pass' : 5. Click 'MyReportsImage'
    '12/21/2012 11:23:05 AM' - 'Pass' : 6. Wait for element 'Create' 'is' visible.
    ------------------------------------------------------------
    '12/21/2012 11:23:05 AM' - Overall Result: Pass
    '12/21/2012 11:23:05 AM' - Duration: [0 min: 4 sec: 520 msec]
    ------------------------------------------------------------
  4. Stoich
    Admin
    Stoich avatar
    1 posts

    Posted 26 Dec 2012 Link to this post

    Hi David,
    the Visibility check relies on the Computed Style of the element as seen through the lens of the browser:
    http://screencast.com/t/0PgO80O1zmA
    Specifically we look at the Display property. display:none means element is not visible. So it might be that the browser itself is not very good at determining the visibility factor. I personally recommend that you refrain from using WaitForVisible because it's not entirely under out control because of the behavior I've just describe.

    Could you please give us the actual failure you've encountered:
    http://tv.telerik.com/watch/automated-testing-tools/test-studio-submitting-support-ticket-for-playback-issues
    Perhaps the problem lies elsewhere.

    I spent a bit of time researching the behavior of the fixed delay steps but I found nothing irregular. Could you put together a little test that demonstrates the issue and tell us what to look for when we run it. We can use that to reproduce the issue and rectify it.

    Hope to hear from you soon.

    Regards,
    Stoich
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  5. David
    David avatar
    25 posts
    Member since:
    May 2012

    Posted 03 Jan 2013 Link to this post

    Thanks Stoich -

    I'll open a support tick to work through the question and attach a project that shows the behavior.  Here is the ticket:

        http://www.telerik.com/account/support-tickets/view-ticket.aspx?threadid=645060

    Please let me know if you have any trouble duplicating the long delays in wait for visible.
  6. Jakub
    Jakub avatar
    2 posts
    Member since:
    Oct 2018

    Posted 14 Dec 2018 in reply to Stoich Link to this post

    Hi Stoich!

     

    Can you please tell me, if also "visibility" style is taken into account ? Like: visibility: hidden; ?

     

    Best Regards,

    Jakub

  7. Elena Tsvetkova
    Admin
    Elena Tsvetkova avatar
    1058 posts

    Posted 19 Dec 2018 Link to this post

    Hello Jakub,

    The option to add advanced verification steps through the recorder toolbar allows you to assert if the element has an attribute visibility: hidden;. The only thing to keep in mind is that the element should be in the hidden state so that the option is listed in the Attributes section. 

    I hope this will work for you. However, if it turns out such verification is not applicable, it may be related to some specifics of the element and page under test. In this case I will appreciate if you can send me a sample test against a public accessible web page to demonstrate the misbehavior. 

    Thanks. 

    Regards,
    Elena Tsvetkova
    Progress Telerik
     
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
Back to Top