Using Smart Screenshots

  • Updated

How does Smart Screenshots really work? When a test is created and every time it's run, we collect data at every step to intelligently select the proper element. Along with this machine learning data, we also collect screenshots at every step. These screenshots help you diagnose errors and also help us verify that the selections and interactions were performed correctly.

Given all of this data, we can map the machine learning data directly to the screenshot. This means that when you want to edit tests, you can directly make certain changes straight from the last execution screenshot.

Note: Smart Screenshots are not available in certain situations:

  • ML Data must have been collected for the previous step's execution, only executions starting April 2021 and later support Smart Screenshots
  • Sometimes ML data cannot be collected for a variety of reasons, try executing the test again if Smart Screenshots are not working as expected

Let's look at three of these Smart Screenshot features:

  • Quick Select allows a user to update the element, since Functionize already knows all the elements on the screen as they relate to the screenshot, the user can simply click on a different element and this Quick Select can be used in a variety of use cases
    • For example: If your site has changed and we did not self-heal correctly or if you selected the wrong element for some reason.
  • Quick Add Actions allows a user to update their test to include certain types of actions, if the previous step has ML data to read from. Some steps, like PageInit Actions, do not pull ML data, so this Quick Add option is not always available
  • SmartFix recommends updates to a user's test if the test has failed, when there are element suggestions, the user can select one of the suggested elements, or the user can select any element, just like with Quick Select

What is Quick Select?

Quick Select is a feature of Functionize's Smart Screenshot that allows you to update the element selected for a particular action. If the wrong element is selected for any reason, as long as that element appears in the screenshot for the action, and we have the corresponding ML data for that action, you will see a Quick Select option to enable you to quickly and easily update the selected element.

Limitations

Since Quick Select is making use of the data our Machine Learning (ML) Engine collects, it does have some limitations:

  • If ML data has not been collected for the particular action or test, Quick Select will not be available, this applies to tests which are not Approved for Learning
  • If ML data was not collected for an action or test, which can happen for a variety of reasons, just try executing the test again if Smart Screenshots are not working as expected

Using Quick Select to Edit a Test

  1. Click View Results  or click on  View button on the right of any action to open the Slider View
  2. Select the action to be updated
  3. Click the Quick Select button.
  4. Highlight the new element in the screenshot, the existing selection will be highlighted in green available elements will be highlighted in blue as you hover and some element information will display to help ensure you select the right item
  5. Click the element, verify the selection is correct, and click Save to continue reviewing, or Save & Run which will proceed to execute the test with the updated action
  6. Once your test has been executed, the footer will display the update between the original Modeled element, the Previous Successful Run (if applicable), and the selection in the Current execution.

What is Quick Add?

Quick Add actions is a feature of Functionize's Smart Screenshot where you can add actions directly from the resulting screenshot. You can add these actions from the Slider View. This feature eliminates the need to run Live Debug or Local Edit for small changes that don't affect the fundamental test flow. The different types of actions that you can select in Quick Add actions include:

  • Hover
  • Verify
  • Click
  • Wait 

Here are some example use cases:

  • Adding a Verify in the middle of a test
  • Including a Wait in case you have an external process that needs to occur
  • Adding a Hover if one was forgotten during test creation
  • Clicking on a popup that doesn't always appear

Adding an Action with Quick Add

  1. Go to the Slider View of the test
  2. Click the Quick Add button at the step where you would like to insert the action.Note: This can only be done when the previous step has ML data. Some actions do not include ML data, and at times, it may not be pulled during execution due to a variety of reasons. See error handling below.
  3. Click the Quick Add button to open the Insert action pop-up
  4. Select the type of action to add, selecting Verify, Click or Hover will prompt the user to click an element on the screenshot, these are different types of Smart Screenshot functions and selecting a Wait action will offer an input field to set the wait time in milliseconds
  5. When adding a Wait action, you have the option of selecting Smart Wait which will watch the network traffic of your site and perform the next action as soon as the site is ready, the Time (in milliseconds) will be the Max Wait Time, or the longest Functionize will wait for your network traffic to complete and move to the next action
  6. Click the Insert button and the action will save and the Slider View will refresh, adding that Wait action to the test

Error Handling

If there is missing ML data on the previous step before the Quick Add , the user will receive a notification that there was missing ML data and only the Wait action is available to insert as a new action.

What is SmartFix?

With all the data collected during both test creation and every test execution, the system understands what to do at every step within the test flow. As changes are made to the application under test, the system does not always determine the correct interaction with the site. However, SmartFix can help you train the system to learn your test's intention, even if the ML gets it wrong. SmartFix will offer several typical types of suggestions to help you easily maintain your tests as your site changes..

Types of SmartFix Suggestion Scenarios

  • Text Verification Suggestions offer updates on verification steps when a assertion fails
  • Password Warning indicate that a password may be incorrect, there is nothing to update with the test in this scenario, but rather assistance in diagnosing a potential issue

Password Warning

In certain instances, we can determine if the password entered on a site is incorrect based on the behavior of the test. Of course, this scenario cannot provide the correct password to fix the test; instead, it simply alerts the user that an incorrect password is the probable cause of the failure. This warning allows the user to go back into the test case and make the appropriate edits to these credentials.

Text Verification Suggestions

  1. Open the Slider View
  2. Scroll to the Failed action that includes the SmartFix tag
  3. Hover on the SmartFix tag and proceed to Review the SmartFix suggestion(s)
    • The first suggestion, Text suffix verification, will update the action operator to Contains instead of Equals the Expected Value: 't Us'
    • The second suggestion, Change text verification, will change the Expected Value from 'About Us' to 'Contact Us'
  4. Click the Review button next to the SmartFix suggestion to fix the failed action, a confirmation modal will appear to update the text from the old to the new without requiring re-recording with Architect, just select the radio button next the update suggestionFor example: Update the operator to Contains versus Equals.
  5. Click the Save button to commit the suggestion update to the test, then re-run the test and test action will Pass