https://github.com/emilwijayasekara/selenium-automation-testing-with-webdriver-test-01
This repository contains a Java-based Selenium test script, Example2.java, demonstrating the automation of interactions with the Guru99 Demo Website for flight reservation. The script covers login, flight details input, and airline selection, providing a foundation for Selenium testing in a web environment.
https://github.com/emilwijayasekara/selenium-automation-testing-with-webdriver-test-01
java selenium selenium-java selenium-webdriver
Last synced: 7 months ago
JSON representation
This repository contains a Java-based Selenium test script, Example2.java, demonstrating the automation of interactions with the Guru99 Demo Website for flight reservation. The script covers login, flight details input, and airline selection, providing a foundation for Selenium testing in a web environment.
- Host: GitHub
- URL: https://github.com/emilwijayasekara/selenium-automation-testing-with-webdriver-test-01
- Owner: EmilWijayasekara
- Created: 2024-01-03T16:01:43.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-03T16:13:10.000Z (almost 2 years ago)
- Last Synced: 2025-01-12T06:09:50.277Z (9 months ago)
- Topics: java, selenium, selenium-java, selenium-webdriver
- Language: Java
- Homepage:
- Size: 16.4 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Selenium Test Example
This is a simple Selenium test example using Java and the Chrome WebDriver to automate interactions with the [Guru99 Demo Website](http://demo.guru99.com/test/newtours/).
## Prerequisites
- Java installed on your machine
- Maven enviroment variables
- Chrome browser installed
- ChromeDriver executable downloaded and placed in the appropriate directory (in this case, `src/main/resources/drivers/`)## Getting Started
1. Clone the repository:
```bash
git clone https://github.com/EmilWijayasekara/Selenium-automation-testing-with-webdriver-test-01.git
```2. Open the project in your preferred Java IDE.
3. Update the ChromeDriver executable path in the code if necessary:
```java
System.setProperty("webdriver.chrome.driver", System.getProperty("user.dir") +
"\\src\\main\\resources\\drivers\\chromedriver.exe");
```4. Run the `Example2` class to execute the Selenium test.
## Description
This Selenium test automates the following steps:
1. Navigate to the Guru99 Demo Website.
2. Log in with a username and password.
3. Go to the flight reservation page.
4. Set various flight details such as one-way trip, passenger count, departing and arriving airports, dates, service class, and airline.
5. Display and print the list of available airlines.
6. Find and display available flights.
7. Close the browser.## Note
- The `Thread.sleep` statements are used for demonstration purposes and may need adjustment based on the speed of your system and network.
- Make sure to update the ChromeDriver version if necessary.### Maven Enviroment
user variables for [user][](https://postimg.cc/K18f4VNZ)
system variables
[](https://postimg.cc/561nWjQQ)
### Feel free to customize this code according to your needs or use it as a reference for your Selenium testing projects.