Question

i have ok button on my dialog box and on the top of dialog new dialog is opening which having again ok button while recording it identify the button but when i run coded ui test then it will not identify second ok button and not clicking on it because of it my test get fail...i am using visual studio 12 ultimate.... please help Thanks in Advance

Was it helpful?

Solution

Use uielements wait methods WaitForControlExist, WaitForControlEnabled and WaitForControlReady before you click when dealing with popups, or any button. It's likely that your tests are trying to click before the popup "ok" button is ready.

uiControl.WaitForControlExist(20000);
uiControl.WaitForControlEnabled(20000);
uiControl.WaitForControlReady(20000);
mouse.click(uiControl);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top