Forum Discussion

zelvin_ng's avatar
zelvin_ng
New Contributor
12 years ago
Solved

Scripts fail randomly in different spot.


Hi,

  I am just wondering why sometime my scripts fail in the middle of the test sometime it pass through the whole scripts with exactly the same scripts 6 hours run. The funny thing is, it fails in the different spot every time the scripts stop. I found out most of the problem is about timing issue and Keys method. I try to avoid some of the timing issue problem by using Wait method. I even need to repeat the 'Keys' method for the one it fails for the first time. The thing is I needs to scripts more tests instead of fixing the issue that occurs randomly in the existing scripts. Is anyone encounters this problem before? Hope anyone can help me out here. Thank you very much


  • As far as I understand your problem is the script is going in a faster pace then the application itself (for example you click "next" and try to click on a button that appears on the next screen, while the button did not load yet).



    You are probably best off with one of the two solutions:



    • You can also set the project itself to act more slowly : 




    1. Right click your project in the "Project workspace"


    2. Edit --> Properties --> Playback


    3. Edit the appropriate parameters to have longer timeout / delay.


    4. For example to wait 5 seconds between each action you perform change "Delay between events,ms" to 5000.






    • You could enter a "wait for button / control" method with a while loop for each time you try to click a control (preferably with a defined timeout).




2 Replies

  • As far as I understand your problem is the script is going in a faster pace then the application itself (for example you click "next" and try to click on a button that appears on the next screen, while the button did not load yet).



    You are probably best off with one of the two solutions:



    • You can also set the project itself to act more slowly : 




    1. Right click your project in the "Project workspace"


    2. Edit --> Properties --> Playback


    3. Edit the appropriate parameters to have longer timeout / delay.


    4. For example to wait 5 seconds between each action you perform change "Delay between events,ms" to 5000.






    • You could enter a "wait for button / control" method with a while loop for each time you try to click a control (preferably with a defined timeout).




  • zelvin_ng's avatar
    zelvin_ng
    New Contributor


    Hi Yotam,



    Thanks for your reply, I agree that the scripts definitely run faster than the application, by increasing the time in "delay between events" section, my scripts run fine without problem. The only downside is it also increases the test running time.



    I have found out window 7 have more visual styles on buttons which causing some delay when button status change from disable to enabled. This maybe the main source causing my scripts fail in different spot. Found out link below very helpful



    http://support.smartbear.com/articles/testcomplete/test-playback-performance-tips/



    I will run the scripts again with "Adjust for best performance" which turn off windows UI Visual Effects.