IntelliJ IDEA
 
Get IntelliJ IDEA
You are viewing the documentation for an earlier version of IntelliJ IDEA.

Selenium Page Objects

Last modified: 10 August 2022

The Selenium UI Testing plugin provides a Chromium-based tool that lets you open web pages and generate code compliant with the page object pattern right in the IDE. This reduces the amount of time spent on boilerplate code and allows you to focus on the testing logic.

When the IDE detects a file that uses the page object pattern, it will suggest opening it in the page object editor.

After you have opened a web page, proceed to picking the page elements that you are going to test. An element can be identified using one the following:

  • XPath selector

  • CSS selector

  • class attribute

  • id attribute

  • name attribute

  • Element text

  • data- attributes, such as data-test

  • aria-label attribute