Sliders | Bondar Academy
Course: AI-based testing with testRigor
Module: Interation with Web Elements
Instructor: Artem Bondar
Lesson Summary
In this lesson, we will discuss how to automate sliders and utilize X and Y coordinates to move your mouse on the screen. Here’s a breakdown of the process: Identifying Elements First, identify the slider element (the "pin") that you will move. Next, determine the area (the "box") where the movement will occur. To inspect the slider, right-click and select "Inspect". Look for attributes like CX , CY , and stroke which can be used as locators. Setting Up Test Trigger In Test Trigger, navigate to Settings > Advanced and add the stroke attribute under Custom Attributes . Identify the slider container using its class name for boundary reference. Understanding Coordinates Every box on a webpage has X (horizontal) and Y (vertical) coordinates starting from the top left corner (0,0). Use these coordinates to define mouse movement: For example, to move to the middle of a 300-pixel wide box, use coordinates like 100, 150 . Executing Mouse Movements To change the temperature gauge: drag to slider pin locator drag to slider container move to coordinates (50, 150) // first movement move to coordinates (50, 350) // second movement After performing these movements, validate the temperature value displayed above the slider. Summary To automate sliders: Use the drag command to move the slider pin. Provide custom attributes in Test Trigger settings. Identify the container for coordinate reference. Utilize X and Y coordinates for mouse movements. That's it for this lesson! See you in the next one.