Automate program to log in and log out. Use Chrome to automate a web test based on given params.
This program is distributed AS-IS, no warranties at all.
This program run over Linux (debian distros like Ubuntu, Xubuntu, Lubuntu or debian), and uses the following requirements:
- Java runtime (openjdk) 17 or higher
- Apache Maven [https://maven.apache.org/download.cgi]
- Selenium Web Package (included in pom.xml)
- Log 4 Java (included in pom.xml)
- Google Chrome Version 109.0.5414.74 (url TBD)
- Selenium Chromedriver for Google Chrome [https://chromedriver.storage.googleapis.com/index.html?path=109.0.5414.74/]
To beginning, you have to download and install prerrequisites: Java runtime 17 (openjdk), Google Chrome and Chromedriver This system has been tested on that components succesfully.
After that, you can clone this repository executing in a terminal:
git clone https://github.com/jyefi/hdg.git
And then you have to generate jar file, executing in a terminal:
mvn clean install package -Dskiptests
The last command, make a maven clean, installs the dependencies (Log4Java and Selenium), and after that generates the jar file.
The program utilizes specific parameters which will be explained below.
- user (mandatory): the username used to log in
- pass (mandatory): the password used to log out
- silent (optional): show/hide UI interface 'true', 'false'
- checkBefore (optional): Verify, if the shift has been previously opened 'true', 'false'
- checkAfter (optional): Verify, if the shift has been previously closed 'true', 'false'
- attendType (mandatory) : ['entrada','salida']
- lang (optional): 'es', 'cat'
The parameters has to given using parameter=value, and it doesn't matter the order. If you don't use this sintaxis, you will get a warning.
For example:
java -jar [jar file] user=johnDoe pass=MySuperSecretPassword1234 attendType=entrada
Running this jar file will initiate a test program. This program will simulate the process of logging in and logging out, and the results will be displayed in the command line.
- Send an email to communicate the result to the user
- Random time before/after
- Read program params from a file