Context Location | Bondar Academy
Course: AI-based testing with testRigor
Module: Locating Web Elements
Instructor: Artem Bondar
Lesson Summary
This lesson focuses on using context location to find web elements within a specific area of a web page. The instructor reviews previous concepts such as relative location , rough location , and strict location using the keyword completely method. Key Concepts Context Location : Refers to searching for web elements within a defined area or "box" on a webpage. Web elements can be identified by their class or other attributes in the Document Object Model ( DOM ). Using context helps in accurately locating elements, especially in complex forms or layouts. Example Walkthrough The instructor demonstrates how to: Navigate to the form layouts page. Identify the inline form using its class inline form card . Click on elements like Email , Remember Me , and Submit buttons within the form. After correcting a typo in the Submit button locator, the test successfully identifies and interacts with the elements. Challenges with Non-Unique Classes In cases where elements share the same class (e.g., CallMD6 ), the instructor suggests: Adding unique identifiers or attributes to the HTML for better automation. Specifying which element to select when multiple elements share the same class. The lesson concludes by emphasizing the importance of context location for web forms and tables, with a promise to cover web tables in future lessons.