Work: 1) click buttonA, which popup WindowX; 2)set_window("X",10); 3)do something on X.
Problem: WinX may take 2 or 10 seconds to popup, so when executing set_windon while WinX not ready, then when set_window check it again? until end of timeout value (10+setting), or it will check every 5 seconds until timeout or winX found. if set_window check at timeout, I put wait(3) between 1) and 2), it set_window check it every few seconds, nothing between. I have many situation like this in my testing. Any idea (I did search and add synchronization even worst, generally). Thanks.
Set_window Should be used every time you switch between windows. for example; if you click buttonA and it opens windowX, the very next step is to set_window. To clarify, this function is executed directly after the function to open the new window is opened. The only reason that shouldn't be the first function is if you are setting a wait time for the window to open.
now say you are closing windowX and going back to the window where you clicked buttonA. THe set_window command must then be used directly after closing windowX.
I just noticed I answered your question completely wrong. My apologies. To answer better, It increases the waiting time as long as it takes your window to load. I do believe you can set the test speed also, if speed is an issue for you.