Forum Discussion

simonaferrara's avatar
simonaferrara
Frequent Contributor
6 months ago

WaitElement doesn't wait till the timeout time on Test Complete version 15.54

Hi! 

 

I've just installed the following Test Complete version: 15.54.3.7 x64 (just before I had the 15.52).

 

I've got Web tests, and I'm not able anymore to use the Page "WaitElement" method, that was working on 15.52 version!

 

It seems that the code doesn't wait anymore for the input timeout, and it returns immediately. For example, I've got a code like this, where the buttonLocator variable is the css selector:

 

let page = Sys.Browser().Page("*");
page.Wait(20000);

..

let buttonDisplayed = page.WaitElement(buttonLocator, 20000);
if (buttonDisplayed.Exists)

    Log.Checkpoint("....");

}

else
{
   Log.Error("....");
}

 

This code frequently fails (the buttonDisplayed.Exists is false) but without waiting the 20 seconds! (I've checked it in debug mode)

 

Is there a bug on 15.54 version for the usage of the Timeout parameter of this method? 

It was perfectly working with the past version 15.52.

 

Regards,

Simona

8 Replies

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    There's a new version of TC v15.55.53.7

     

    When you say WaitElement, are you waiting for the button to become enabled, visible or exist? 

  • simonaferrara's avatar
    simonaferrara
    Frequent Contributor

    rraghvani I've also tried now bu using a code like this:

    if (buttonDisplayed.WaitProperty("Exists", true, 20000))

    {
       Log.Checkpoint("....");
    }
    else
    {
      Log.Error("....");
    }


    and it doesn't wait for 20 seconds for the Exists property to true!
    It goes immediately within the else statement by logging the error.

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Using the following website https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_toggle_hide_show, here's sample code that uses WaitElement method to wait for 'This is my DIV element.' block to appear.

     

    function Element()
    {
        var page = Aliases.browser.Page("https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_toggle_hide_show").FindElement("#iframeResult")
        var element = page.WaitElement("//DIV[@style='display: block;']", 10000);
        if (element.Exists)
            Sys.HighlightObject(element);
        else
            Log.Message("Element does not exist");
    }
    

     

     

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    WaitProperty method,

    function Property()
    {
        var page = Aliases.browser.Page("https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_toggle_hide_show").FindElement("#iframeResult")
        var element = page.FindElement("#myDIV");
        var property = element.WaitProperty("Visible", true, 10000);
        if (property)
            Sys.HighlightObject(element);
        else
            Log.Message("Property visible not true");    
    }
  • simonaferrara's avatar
    simonaferrara
    Frequent Contributor

    rraghvani I've correctly implemented my methods as per documentation. 

     

    I would like to have confirmation that there is a bug on 15.54 version for which both the WaitElement and the WaitProperty don't wait at all for the input timeout, because this is the current behavior on 15.54.

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Works fine using TC v15.55 with Microsoft Edge for Business v116.0.1938.69 (Official build) (64-bit) and Google Chrome v116.0.5845.141 (Official Build) (64-bit)

  • simonaferrara's avatar
    simonaferrara
    Frequent Contributor

    I confirm that the WaitElement correctly works on latest v15.55, and I repeat that it doesn't work on v15.54 (the WaitElement immediately returns without waiting for the specified timeout).

     

    I would suggest to the technicians to take in consideration this post and possibly mention this fix within the changelog list of v15.55, to prevent that any other user will fall to take time on this analysis.

     

    Regards,

    Simona