Skip to content

Commit 1632407

Browse files
authored
Add files via upload
1 parent a50029d commit 1632407

File tree

3 files changed

+250
-64
lines changed

3 files changed

+250
-64
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module type="JAVA_MODULE" version="4" />

pom.xml

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>org.example</groupId>
8+
<artifactId>Selenium-Java-Cucumber-TestNG-ParallelTest</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
<build>
11+
<plugins>
12+
<plugin>
13+
<groupId>org.apache.maven.plugins</groupId>
14+
<artifactId>maven-compiler-plugin</artifactId>
15+
<version>3.10.1</version>
16+
<configuration>
17+
<source>1.8</source>
18+
<target>1.8</target>
19+
</configuration>
20+
</plugin>
21+
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
22+
<plugin>
23+
<artifactId>maven-clean-plugin</artifactId>
24+
<version>3.1.0</version>
25+
</plugin>
26+
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
27+
<plugin>
28+
<artifactId>maven-resources-plugin</artifactId>
29+
<version>3.0.2</version>
30+
</plugin>
31+
<plugin>
32+
<artifactId>maven-surefire-plugin</artifactId>
33+
<version>2.22.1</version>
34+
</plugin>
35+
<plugin>
36+
<artifactId>maven-jar-plugin</artifactId>
37+
<version>3.0.2</version>
38+
</plugin>
39+
<plugin>
40+
<artifactId>maven-install-plugin</artifactId>
41+
<version>2.5.2</version>
42+
</plugin>
43+
<plugin>
44+
<artifactId>maven-deploy-plugin</artifactId>
45+
<version>2.8.2</version>
46+
</plugin>
47+
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
48+
<plugin>
49+
<artifactId>maven-site-plugin</artifactId>
50+
<version>3.7.1</version>
51+
</plugin>
52+
<plugin>
53+
<artifactId>maven-project-info-reports-plugin</artifactId>
54+
<version>3.0.0</version>
55+
</plugin>
56+
</plugins>
57+
</build>
58+
<properties>
59+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
60+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
61+
</properties>
62+
63+
<dependencies>
64+
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
65+
<dependency>
66+
<groupId>org.seleniumhq.selenium</groupId>
67+
<artifactId>selenium-java</artifactId>
68+
<version>4.4.0</version>
69+
</dependency>
70+
71+
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-firefox-driver -->
72+
<dependency>
73+
<groupId>org.seleniumhq.selenium</groupId>
74+
<artifactId>selenium-firefox-driver</artifactId>
75+
<version>4.6.0</version>
76+
</dependency>
77+
78+
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-safari-driver -->
79+
<dependency>
80+
<groupId>org.seleniumhq.selenium</groupId>
81+
<artifactId>selenium-safari-driver</artifactId>
82+
<version>4.4.0</version>
83+
</dependency>
84+
85+
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-chrome-driver -->
86+
<dependency>
87+
<groupId>org.seleniumhq.selenium</groupId>
88+
<artifactId>selenium-chrome-driver</artifactId>
89+
<version>4.4.0</version>
90+
</dependency>
91+
92+
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-edge-driver -->
93+
<dependency>
94+
<groupId>org.seleniumhq.selenium</groupId>
95+
<artifactId>selenium-edge-driver</artifactId>
96+
<version>4.4.0</version>
97+
</dependency>
98+
99+
100+
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-api -->
101+
<dependency>
102+
<groupId>org.seleniumhq.selenium</groupId>
103+
<artifactId>selenium-api</artifactId>
104+
<version>4.4.0</version>
105+
</dependency>
106+
107+
<!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-java -->
108+
<dependency>
109+
<groupId>io.cucumber</groupId>
110+
<artifactId>cucumber-java</artifactId>
111+
<version>6.10.3</version>
112+
</dependency>
113+
114+
<!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-junit -->
115+
<dependency>
116+
<groupId>io.cucumber</groupId>
117+
<artifactId>cucumber-junit</artifactId>
118+
<version>6.11.0</version>
119+
<type>pom</type>
120+
</dependency>
121+
122+
<!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-core -->
123+
<dependency>
124+
<groupId>io.cucumber</groupId>
125+
<artifactId>cucumber-core</artifactId>
126+
<version>7.8.1</version>
127+
</dependency>
128+
129+
<!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-gherkin -->
130+
<dependency>
131+
<groupId>io.cucumber</groupId>
132+
<artifactId>cucumber-gherkin</artifactId>
133+
<version>7.2.3</version>
134+
</dependency>
135+
136+
<!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-testng -->
137+
<dependency>
138+
<groupId>io.cucumber</groupId>
139+
<artifactId>cucumber-testng</artifactId>
140+
<version>7.3.4</version>
141+
</dependency>
142+
143+
<!-- https://mvnrepository.com/artifact/org.testng/testng -->
144+
<dependency>
145+
<groupId>org.testng</groupId>
146+
<artifactId>testng</artifactId>
147+
<version>6.14.3</version>
148+
<scope>test</scope>
149+
</dependency>
150+
151+
<!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-junit -->
152+
<dependency>
153+
<groupId>io.cucumber</groupId>
154+
<artifactId>cucumber-junit</artifactId>
155+
<version>6.9.0</version>
156+
<scope>test</scope>
157+
</dependency>
158+
</dependencies>
159+
</project>

readme.md

Lines changed: 89 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,89 @@
1-
# README FIRST
2-
3-
## Notes:
4-
This paralel testing mobile automation using TestNG.
5-
6-
## Tools:
7-
1. Intellij IDEA
8-
2. Appium
9-
3. TestNG
10-
4. JDK
11-
5. Android SDK
12-
6. Node.js
13-
14-
## URL refs:
15-
1. [Maven Repo] (https://mvnrepository.com/artifact/info.cukes).
16-
2. [Intellij IDEA] (https://www.jetbrains.com/idea/download/#section=windows).
17-
3. [JDK] (http://www.oracle.com/technetwork/java/javase/downloads/index.html).
18-
4. [Node.js] (https://nodejs.org/en/).
19-
5. [Android SDK] (https://developer.android.com/sdk/download.html).
20-
6. [Maven Repository] (https://mvnrepository.com/).
21-
22-
## Installing Appium:
23-
1. Install Node.js first. (If using Linux, do not install Node from package but from Node website)
24-
2. Open command prompt.
25-
3. Type a command: ```npm install -g appium``` then press enter
26-
27-
## Environment Variable:
28-
#### Windows
29-
1. Make a new variable with name: ```JAVA_HOME``` and value ```C:\Program Files\Java\java-8```
30-
2. Make a new variable with name: ```ANDROID_HOME``` and value ```C:\Android\Android-sdk```
31-
3. Edit PATH variable and add new value at the back
32-
```;C:\Android\Android-sdk\tools;C:\Android\Android-sdk\platform-tools;C:\Program Files\Java\java-8\bin```
33-
34-
#### Linux
35-
1. Open your bashrc file using command ```gedit ~/.bashrc```
36-
2. Type this value on first line:
37-
```export JAVA_HOME=/usr/lib/jvm/java-8```
38-
```export ANDROID_HOME=/home/itworker/Android/Sdk```
39-
```export PATH=$PATH:$ANDROID_HOME/tools```
40-
```export PATH=$PATH:$ANDROID_HOME/platform-tools```
41-
```export PATH=$PATH:/usr/lib/jvm/java-8/bin```
42-
3. Save and reboot your Linux
43-
44-
_Directory mentioned above is depend of your JDK and Android SDK directory. If not give affect, try type that conf to .profile or .bash profile file_
45-
46-
## Project Structure Setup:
47-
1. Open Intellij IDEA, Click File > Project Structure > Project
48-
2. Choose Project SDK and Project language level according to your JDK
49-
3. Click Modules > + > Import Module, point to automation folder
50-
4. Click Libraries > + > Java, point to automation folder
51-
52-
## Setup:
53-
1. Open with Intellij IDEA
54-
2. Open device.xml
55-
3. Arrange according to your device
56-
57-
### You can get the UD/ID device with command on command prompt:
58-
```
59-
adb devices
60-
```
61-
62-
## Run the automation:
63-
1. Open with Intellij IDEA
64-
2. Right click device.xml > Run
1+
# Selenium-Java-using-POM-without-PageFactory
2+
3+
## 1. POM
4+
5+
This automation created using POM design pattern. What is POM? POM stands for Page Object Model. POM is a design pattern used to make automation. Where each page an application or website is used as its own class. This gives an advantage when one of a page's interface changes, then other classes will not be affected.
6+
7+
## 2. Cucumber dan Gherkin
8+
9+
Then for Scenario scripting, we will use Cucumber and Gherkin.<br/>
10+
What is Cucumber? What is Gherkin?<br/>
11+
**Cucumber** is a tool that supports BDD *(Behavior-Driven Development)*.<br/>
12+
**Gherkin** is a set of grammar rules that makes plain text structured enough to be understood by Cucumber. Scenario scripts are written using Gherkin.<br/><br/>Referensi: https://docs.cucumber.io/docs/guides/overview/
13+
14+
## 3. Preparation
15+
16+
| Unsur | Item |
17+
| ------------ | ------------------------------------------------------------ |
18+
| Editor | Intellij IDEA Community (https://www.jetbrains.com/idea/download/#section=windows) |
19+
| JDK | JDK 8 (https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html) |
20+
| Web Driver | Chrome Driver (https://chromedriver.chromium.org/downloads)<br />Firefox Driver (https://github.com/mozilla/geckodriver/releases) |
21+
| Browser | Chrome latest version<br />Mozilla Firefox latest version |
22+
| Dependencies | artifactId: `selenium-java`, groupId: `org.seleniumhq.selenium` <br />artifactId: `selenium-firefox-driver`, groupId: `org.seleniumhq.selenium`<br />artifactId: `selenium-safari-driver`, groupId: `org.seleniumhq.selenium`<br />artifactId: `selenium-chrome-driver`, groupId: `org.seleniumhq.selenium`<br />artifactId: `selenium-api`, groupId: `org.seleniumhq.selenium`<br />artifactId: `cucumber-junit`, groupId: `info.cukes`<br />artifactId: `cucumber-java`, groupId: `info.cukes`<br />artifactId: `cucumber-core`, groupId: `info.cukes`<br />artifactId: `gherkin`, groupId: `info.cukes`<br />artifactId: `testng`, groupId: `org.testng` |
23+
24+
## 4. Installation
25+
26+
Install Editor Intellij Idea Community and JDK in komputer.
27+
28+
## 5. Configuration
29+
30+
#### Windows
31+
32+
###### JDK 8
33+
34+
1. Right-click My Computer > Properties > Advance system settings > Environment Variables > PATH > Edit
35+
2. Type `C:\Java\java-8\bin`
36+
3. Click Save
37+
38+
#### Linux dan Mac OS
39+
40+
###### JDK 8
41+
42+
*Automatically set itself*
43+
44+
## 6. Project
45+
46+
#### Clone
47+
48+
Clone this repository using this command `git clone https://github.com/cahkla10/Selenium-Java-using-POM-without-PageFactory` in terminal or command prompt.
49+
50+
### Intellij IDEA Configuration
51+
52+
Open this automation using Intellij IDEA.
53+
54+
##### Project Setting
55+
56+
1. Click File > Project Structure
57+
2. Make sure JDK 8 is selected in Project SDK
58+
59+
##### Plugin
60+
61+
1. Klik Preferences > Plugins
62+
2. Search using keyword `cucumber for java`
63+
3. Click Install
64+
4. Repeat steps 2-3 for plugin `gherkin`
65+
66+
## 7. Package & Class
67+
68+
### Struktur Project
69+
70+
```
71+
|-- test
72+
|-- java
73+
|-- helpers
74+
|-- pages
75+
|-- setups
76+
|-- steps
77+
|-- resources
78+
|-- features
79+
```
80+
81+
- `helpers` package for Runner class or other required class
82+
- `pages` package for all page classes.
83+
- `setups` package for all automation configuration.
84+
- `steps` package for all page step definitions.
85+
- `resources` package for all features or non java classes.
86+
87+
## 8. Running Automation
88+
89+
For running the automation, open Runner class and run it.

0 commit comments

Comments
 (0)