-
- Launching Browsers
- Launching Browsers In Headless Mode
- Locators in Selenium
- WebDriver Browser Commands
- WebDriver Navigation Commands
- Waits in Selenium
- Automate Radio Button in Selenium
- Automate Checkbox in Selenium
- DropDown in Selenium
- Alerts in Selenium
- Form WebElement Commands
- Mouse Events In Selenium
- Keyboard Events In Selenium
- Browser Tab
- Browser Window
- Frame In Selenium
- Assertion
- Web Table
- Scroll in Selenium
This repository serves as a comprehensive guide to working with Selenium WebDriver using Java. Whether you're a beginner looking to get started with Selenium for automated testing or an experienced developer seeking advanced browser handling techniques, this repository has something for everyone.
Follow these steps to set up your development environment and start using Selenium with Java
- Java JDK
- Choose one of the following IDE:
- Apache Maven
- Java JDK
- Download the installer from the Oracle Java SE Downloads page.
- Run the installer and set up the JDK.
- IDE
- Download and install your preferred IDE.
- Apache Maven
- Download Apache Maven from the official website.
- Follow installation instructions.
- Download the JDK installer from Oracle.
- Run the installer and select your installation folder.
- Set up JAVA_HOME and PATH environment variables: - Open System Properties. - Navigate to Environment Variables. - Add JAVA_HOME with the JDK installation path. - Update the PATH variable to include %JAVA_HOME%\bin.
- Verify Java installation by running java --version in a terminal.
- Download Spring Tools from the official website.
- Run the installer and select the package to install.
- Choose your installation folder and complete the setup.
- Launch Spring Tools to start using it.
- Check if you have Java installed by running java --version.
- Download Apache Maven from the official website.
- Extract the archive to your desired location.
- Set up M2_HOME and MAVEN_HOME environment variables:
- Create M2_HOME and point it to the Maven installation directory.
- Update the PATH variable to include %M2_HOME%\bin.
- Verify Maven installation by running mvn --version in a terminal.
- Java JDK - Java Development Kit
- Spring Tools - IDE for Spring applications
- Apache Maven - Dependency Management
To start using the framework:
- Fork the repository.
- Clone, i.e, download your copy of the repository to your local machine using
git clone https://github.com/ebrahimhossaincse/Selenium-Tutorials-Java.git
- Import the project into your preferred IDE (Eclipse, IntelliJ IDEA, or Spring Tools).
- Make any desired changes or additions to the project.
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>4.13.0</version>
</dependency>
<!--
https://mvnrepository.com/artifact/io.github.bonigarcia/webdrivermanager -->
<dependency>
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
<version>5.5.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.testng/testng -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>7.8.0</version>
<scope>test</scope>
</dependency>
</dependencies>
- 00 - 00 How to run Selenium Tests using Chrome?
- 00 - 01 How to run Selenium Tests using Firefox?
- 00 - 02 How to run Selenium Tests using Edge?
- 00 - 03 How to run Selenium Tests using Safari?
- 00 - 04 How to Configure cross browser in Selenium?
- 01 - 00 How to run Chrome tests in headless mode in Selenium?
- 01 - 01 How to run Firefox tests in headless mode in Selenium?
- 01 - 02 How to run Edge tests in headless mode in Selenium?
- 02 - 00 Locate by ID
- 02 - 01 Locate by Name
- 02 - 02 Locate by Class Name
- 02 - 03 Locate by CSS Selector
- 02 - 04 Locate by Link Text
- 02 - 05 Locate by Partial Link Text
- 02 - 06 Locate by Tag Name
- 02 - 07 Locate by Absolute XPath
- 02 - 08 Locate by Relative XPath
- 02 - 09 Locate by Text
- 02 - 10 Locate by Starts With
- 02 - 11 Locate by Preceding
- 02 - 12 Locate by Position
- 02 - 13 Locate by OR Expression
- 02 - 14 Locate by AND Expression
- 02 - 15 Locate by Contains
- 02 - 16 Locate by Last
- 03 - 00 Retrieve Title Of Current WebPage
- 03 - 01 Retrieve Current URL Of Current WebPage
- 03 - 02 Retrieve Attribute Value By Get Attribute
- 03 - 03 Retrieve The Class Object
- 03 - 04 Retrieve Text By Get
- 03 - 05 Retrieve Page Source Of Current WebPage
- 03 - 06 Retrieve Location By Get Location
- 04 - 00 Navigate To
- 04 - 01 Refresh
- 04 - 02 Back
- 04 - 03 Forward
- 06 - 00 Single Radio Button Selection
- 06 - 01 Group Radio Button Selection
- 07 - 00 Select Checkbox By ID
- 07 - 01 Select Checkbox By XPath
- 07 - 02 Select Multiple Checkboxes
- 07 - 03 Unselect Checkbox By ID
- 07 - 04 Unselect Checkbox By XPath
- 07 - 05 Unselect Multiple Checkboxes
- 08 - 00 Select By Index
- 08 - 01 Select By Value
- 08 - 02 Select By Visible Text
- 08 - 03 Fetch List of options in dropdown
- 08 - 04 DeSelect By Index
- 08 - 05 Deselect By Value
- 08 - 06 Deselect By Visible Text
- 09 - 00 Accept Simple Alert
- 09 - 01 Accept ConfirmA lert
- 09 - 02 Accept Prompt Alert
- 09 - 03 Fetch Text Of Prompt Alert
- 09 - 04 Send Text In Prompt Alert
- 09 - 05 Reject Confirm Alert
- 09 - 06 Reject Prompt Alert
- 11 - 00 Click
- 11 - 01 Click And Hold
- 11 - 02 Double Click
- 11 - 03 Drag And Drop
- 11 - 04 Drag And Drop By Offset
- 11 - 05 Move By Offset
- 11 - 06 Move To Element
- 11 - 07 Right Click
- 12 - 00 Keyboard Events
- 13 - 00 Create New Tab
- 13 - 01 Count The Tabs
- 13 - 02 Switch To New Tab
- 13 - 03 Switching One Tab To Another
- 14 - 00 Create New Window
- 14 - 01 Count The Window
- 14 - 02 Switch To New Window
- 14 - 03 Switching One Window To Another
- 15 - 00 Count The Total Number Of IFrames
- 15 - 01 Switch To Frames By ID
- 15 - 02 Switch To Frames By Index
- 15 - 03 Switch To Frames By Name
- 15 - 04 Switch To Frames By WebElement
- 15 - 05 Switch Back To Default
- 16 - 00 Assert Equals
- 16 - 01 Assert False
- 16 - 02 Assert Not Equals
- 16 - 03 Assert Not Null
- 16 - 04 Assert True
- 16 - 05 Soft Assertion
- 17 - 00 Fetch Table Heading
- 17 - 01 Count Number Of Rows And Columns
- 17 - 02 Fetch Cell Value Of Particular Row And Column
- 17 - 03 Get Maximum Price In Column
- 18 - 00 Scroll Down
- 18 - 01 Scroll UP
- 18 - 02 Scroll To A Specific Element
- 18 - 03 Horizontal Scroll
Special thanks to the contributors and the Selenium community for their valuable resources and tutorials.
For questions or feedback, please feel free to reach out:
- Maintainer: Md. Ebrahim Hossain
- Project Link:Selenium-Tutorials-Java
- Facebook: Md. Ebrahim Hossain
- Linkedin: Md. Ebrahim Hossain
- Stack Overflow: Md. Ebrahim Hossain
- Medium: Md. Ebrahim Hossain