An open API service indexing awesome lists of open source software.

https://github.com/geozi/selenium-java-junit-popupwindow

Showcases the use of Selenium with Java and JUnit for performing functional tests on a pop-up window.
https://github.com/geozi/selenium-java-junit-popupwindow

functional-testing junit5 oop selenium-java surefire-reporting

Last synced: about 1 year ago
JSON representation

Showcases the use of Selenium with Java and JUnit for performing functional tests on a pop-up window.

Awesome Lists containing this project

README

          

# selenium-java-junit-popupwindow
![Functional Testing Demo App](https://img.shields.io/badge/Demo_project-blue)

### About the project
The project showcases the use of Selenium with Java and JUnit for performing functional tests on a pop-up window.

### Website[^1]
The website where the element is located is the https://www.netcompany-intrasoft.com/ .

### Web element under test

The web element tested was the cookie pop-up window found on the landing page of the website:



### OOP

To make full use of Java as a pure Object-Oriented language and, by extension, optimize code organization, a small class hierarchy was developed. Each subclass simulates a concrete user action.



### Horizontal vs vertical testing

There are 6 test classes, each of which corresponds to an element of the pop-up window. Taking advantage of JUnit's ordering capabilities, the test classes are run according to a custom order (horizontal testing).

| Ordering number | Window element | Test class |
|------------- | ------------- | ------------- |
| #1 | 'click me' link | ClickMeTest |
| #2 | Analytics checkbox | PerformanceCheckBoxTest |
| #3 | Twitter checkbox | TwitterCheckBoxTex |
| #4 | Meta checkbox| FacebookCheckBoxTest |
| #5 | Accept All Cookies button | AcceptAllCookiesTest |
| #6 | Reject All Cookies button| RejectAllCookiesTest |

Furthermore, each class contains test methods that correspond to a series of simulated steps per window element. As in the case of the test classes, the test methods are run according to a custom order (vertical testing).

### Prerequisites
* Java 17 or higher,
* Intellij IDEA (or any other Java IDE),
* Maven,
* Selenium.

### Dependencies
```xml



org.seleniumhq.selenium
selenium-java
4.23.0



org.seleniumhq.selenium
selenium-firefox-driver
4.23.0



org.seleniumhq.selenium
selenium-chrome-driver
4.23.0



org.junit.jupiter
junit-jupiter-engine
5.10.3
test



org.junit.jupiter
junit-jupiter-api
5.10.3
test

```

### Further documentation

For more information, please check the provided javadoc.






[^1]: Disclaimer: This website was tested in order to showcase the use of Selenium with Java and JUnit 5, and such testing does not constitute an endorsement or promotion of said website.