A window created by RadWindowManager cannot be located by Test Studio when the test is executing.
Take the following sample test:
- Navigate to http://demos.telerik.com/aspnet-ajax/window/examples/browserdialogboxes/defaultcs.aspx (which is a Telerik Demo Page for RadAlert, RadPrompt and RadConfirm).
- Click the radconfirm from client button.
- Enable hover over highlighting and click the nub corresponding to the RadWindow.
- Build a Verification on the Window State: Verify Window Is Modal.
- Click OK in the Client RadConfirm modal window.
- Click OK in the Result window.
The test fails at step 3. The element to verify cannot be located because RadConfirms have randomly created IDs (when RadManager creates a window, it gives it an ID with a randomly created postfix).
- When the test was recorded, Test Studio found the element by its ID at the time (RadWindowWrapper_confirm1313072726560).
- When the test was executed, RadWindowManager creates a new window with a different ID, so the search fails and the element cannot be found.
We can handle this by not searching for the entire ID of the element, rather just for the consistent part of it. In the Steps Pane, click on step 3. Go to the Elements Explorer and that element will be selected. Right-click the element and select Edit Element from the context menu.
- Choose Find Without Connection.
- Under Find Settings, locate the id line.
- Change is exactly to contains.
- Remove the postfix of the ID and leave only RadWindowWrapper.
- Click Save and execute the test again.