locked
WaitForControl Exist Timeout not work after I set PlaybackSettings.WaitForReadyLevel = WaitForReadyLevel.Disabled RRS feed

  • Question

  • Dear all,

    I have written a simple WinForm program and use the Coded UI Test to test this

    We aim to test the WaitForControl Timeout not work issue, and I find that when I set the following,

    Playback.PlaybackSettings.WaitForReadyLevel = WaitForReadyLevel.Disabled


    And I find that even I set the timeout at WaitForControlExist (1000) as following, it wait for over 10 seconds

    If uIOKButton.WaitForControlExist(1000) Then
         Mouse.Click(uIOKButton, New Point(63, 11))
    End If

    And when I comment out this statement and I find that the timeout work normally, and only wait for 1s and go to next statement,

    What's the purpose of this setting? is there any impact if we not set?

    Why it would cause the timeout not work?

    Best Regards

    Thursday, July 4, 2013 8:50 AM

Answers

  • Hi TungLee,

    Sorry for my delay.

    I’m afraid that it is hard to set the real time value. As my understanding, if the coded UI test spends long time, we could check whether we could improve the performance of this test. If the specific control loaded slowly in your app, you would discuss it with your development team, and improve the performance of your app UI.

    In addition, the different Environments or the different configuration would impact the running. If you run your test in other machine, I’m afraid that you would get different time for waiting. If you really want to run your test quickly, maybe you could try to set the different value, and then check it in your side, I mean that you would select the better value settings for it in your Environment.

    Sincerely,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, July 12, 2013 8:24 AM

All replies

  • Hi TungLee,

    If uIOKButton.WaitForControlExist(1000) Then

         Mouse.Click(uIOKButton, New Point(63, 11))

    End If

    Maybe you could share us more detailed information about this issue, the default value you set is wait for the control for 1 s in above code, am I right? If you set “Playback.PlaybackSettings.WaitForReadyLevel = WaitForReadyLevel.Disabled”, it waited for 10 s, am I right? If so, how about disabling “uIOKButton.WaitForControlExist(1000)”? I mean that you could just use the “Playback.PlaybackSettings.WaitForReadyLevel = WaitForReadyLevel.Disabled” in your test.

    As my understanding, they would be different events.

    WaitForReadyLevel: Denotes the WaitForReadyLevel to use for calls to the WaitForReady method.

    WaitForControlExist(Int32) : Blocks the current thread until this control occurs in the user interface, or until the specified time-out expires.

    http://msdn.microsoft.com/en-IN/library/microsoft.visualstudio.testtools.uitest.extension.uitechnologyelement.waitforready.aspx

    http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.testtools.uitesting.uitestcontrol.waitforcontrolexist.aspx

    Best Regards,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, July 8, 2013 9:20 AM
  • yes, you understanding is correct

    And your suggestion that remark the WaitForControlExist(1000) and keep WaitFor ReadyLevel

    1. it not wait anymore

    2. but as I mention that I have some case that have the button, thats' why I put the Mouse Click on the OK button.

    I also have more finding on the case that seem it spend long time to perform the search control in some case. And I find that when I set the searchtimeout (e.g. 500) to short, the wait time would become 5s, but if I set to too small (e.g. 100) some time it cannot search the control for other scenario... hence it's my concern that

    1. some time I cannot make sure the control exist since there are many alternative program flow in normal application

    2. when the Coded UI try to search some non-exist component, event we set the waitforcontrol timeout to 100ms, it still spend time on search component,

    3. but we cannot set the search timeout to very short as it would cause error for some case that application load the component a bit slower ...

    For above finding, what's the suggested value setting for WaitForControl Timeout and Search Timeout?

    how can I minimize the wait time if the components not exist in some alternative path?

    One more things that I have to develop a very simple Win App and Test Project for this case, is there any way that I can attach this so that you can try the behavior...

    Best Regards


    • Edited by TungLee Thursday, July 11, 2013 6:39 AM supp
    Thursday, July 11, 2013 6:37 AM
  • Hi TungLee,

    Sorry for my delay.

    I’m afraid that it is hard to set the real time value. As my understanding, if the coded UI test spends long time, we could check whether we could improve the performance of this test. If the specific control loaded slowly in your app, you would discuss it with your development team, and improve the performance of your app UI.

    In addition, the different Environments or the different configuration would impact the running. If you run your test in other machine, I’m afraid that you would get different time for waiting. If you really want to run your test quickly, maybe you could try to set the different value, and then check it in your side, I mean that you would select the better value settings for it in your Environment.

    Sincerely,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, July 12, 2013 8:24 AM