Change How an Element Is Found (R1 2011 SP1)

This guide is for the Find Expression Builder UI present in Test Studio version 2011.1.5xx - 2011.1.6xx. For versions 2011.1.7xx to present, please see our Find Element (R1 2011 SP2) article.

 

When a web page element has an action recorded against it, or you explicitly add an element to the Elements pane, a "Find Expression" is generated that Test Studio uses to find that specific element on the web page.

 

    1. To change how an element is found, right click on the element in the Explorer and select "Edit Element" (or "Find Element").

 

        

 

        In the VS plugin, click the "Show Element Explorer" icon in the toolbar and locate the Explorer at the bottom of the screen.

 

               

 

    2. The "Find Expression Builder" launches and displays how the element is currently found.

 

        

 

    3. The "Find Expression Builder" consists of the following:

        a. Web Page Information - Friendly Name and Page URL. 
        b. Element Information - Friendly Name, the number of tests and steps used in, Element type, Status, and DOM View. 

 

    Note: If the Builder is in Offline View (Disconnected), as shown above, choose one of the three Find Expression Validation Options to bring it into Online View (Connected).

 

        c. Find Expression Validation Options - three ways to connect to the browser and validate the find expression. 
                i. Connect to an existing, open browser with the page loaded that contains the element. Click the drop-down to see open instances of IE. 

 

                    

                ii. Launch a new browser and navigate to Web Page URL. Use this if IE is not open. 

 

                    

 

                iii. Choose a step from the projects’ tests and execute to this step. 

 

                    

 

    The Find Expression Builder should now be in Online View (Connected).

    

    

 

        d. The Validation Options area converts to a list of element attributes and their values.

                 i. Use the "And" button to add a narrative clause to the element regular find expression. This makes the search method more strict.

                ii. Use the "Then" button to add a narrative clause to the chain find expression. Useful for optimizing the find method, e.g. first search a unique parent then look for the element.

 

                    

 

        e. Current Find Expression Narrative – represents the find expression with a simple statement. Edit by hovering over the applicable words or phrases and click when the white pen appears. Delete a statement by clicking the “X” at the beginning of it. 
                i. Element Attribute – the property or attribute of the element to examine. Examples include:

                    HTML elements - TextContent, NodeIndexPath, TagName, TagIndex, and XPath.

                    HTML attributes - name, id, and visibility.

                    XAML elements - TextContent, XamlTag, Name, and TagIndex.

                    XAML attributes - Foreground and Content. 

 

                    

 

                ii. Change the compare type via the drop-down menu (e.g. is exactly, contains, starts with, etc.). 

 

                    

 

                iii. Value to look for – can be a string, number, index path (tag or XAML index), or a RegEx expression. 

 

                    

 

                iv. Click the “Expert View” button to view the Find Expressions on a single, editable line. Press the "Validate" button. Confirm the "Validation Succeeded" message.