Locating RadWindowManager

PROBLEM

A window created by RadWindowManager cannot be located by Test Studio when the test is executing.

DESCRIPTION

Take the following sample test:

  1. Navigate to http://demos.telerik.com/aspnet-ajax/window/examples/browserdialogboxes/defaultcs.aspx (which is a Telerik Demo Page for RadAlert, RadPrompt and RadConfirm).
  2. Click the radconfirm from client button.
  3. Enable hover over highlighting and click the nub corresponding to the RadWindow.
  4.  

     

     

  5. Build a Verification on the Window State: Verify Window Is Modal.
  6.  

     

     

  7. Click OK in the Client RadConfirm modal window.
  8. Click OK in the Result window.
  9.  

     

    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.

SOLUTION

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.

 


 

  1. Choose Find Without Connection.
  2. Under Find Settings, locate the id line.
  3. Change is exactly to contains.
  4. Remove the postfix of the ID and leave only RadWindowWrapper.
  5. Click Save and execute the test again.
  6.