> For the complete documentation index, see [llms.txt](https://testingvn.gitbook.io/automationtester/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://testingvn.gitbook.io/automationtester/getting-started/quickstart.md).

# Setup

<figure><img src="https://images.unsplash.com/photo-1556911220-bff31c812dba?crop=entropy&#x26;cs=srgb&#x26;fm=jpg&#x26;ixid=M3wxOTcwMjR8MHwxfHNlYXJjaHwyfHxwcmVwYXJlfGVufDB8fHx8MTczMjc3NjU2MHww&#x26;ixlib=rb-4.0.3&#x26;q=85" alt=""><figcaption></figcaption></figure>

### Install Java JDK

1. Cài đặt [Java JDK](https://www.oracle.com/java/technologies/javase/jdk11-archive-downloads.html) 11 trở lên

&#x20; 2\. Thiết lập biến môi trường **JAVA\_HOME**

* Cho [Windows 7](https://medium.com/@tushar0618/setting-java-home-variable-on-windows-7-bab344b6f3c4)
* Cho [Windows 10](https://mkyong.com/java/how-to-set-java_home-on-windows-10/)
* Cho [Linux](https://www.baeldung.com/linux/path-variable)
* Cho MAC OS

{% hint style="info" %}
From OS X 10.5, Apple introduced a command line tool (/usr/libexec/java\_home) which dynamically finds the top Java version specified in Java Preferences for the current user.

Open \~/.bash\_profile in any text editor and add:

Save and close the file.

Open a Terminal and run the source command to apply the changes:
{% endhint %}

```
    $ source ~/.bash_profile

    Now we can check the value of the JAVA_HOME variable:

    $ echo $JAVA_HOME

    The result should be the path to the JDK installation:
  
    $ /Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home
```

### Setup Maven

* Download [apache-maven-3.9.1](https://maven.apache.org/download.cgi)
* Sau đó giải nén file zip.
* Thêm đường dẫn **your-dir/apache-maven-3.9.1/bin** vào biến **PATH**

### **Install IntelliJ**

* [https://www.jetbrains.com/idea/download](https://www.jetbrains.com/idea/download/?section=mac)

<figure><img src="https://2578005143-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVXRZtTS5yRYmkC3p9zkH%2Fuploads%2F88mYXzt3ZWl7U1PYmr8L%2FScreenshot%202024-11-28%20at%2013.52.45.png?alt=media&amp;token=07df0700-58be-43dd-a251-6a6020d40786" alt=""><figcaption><p>Select Commnuniti verion for Free</p></figcaption></figure>

### Create Maven Project&#x20;

* <https://www.jetbrains.com/guide/java/tutorials/working-with-maven/creating-a-project/>

<figure><img src="https://2578005143-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVXRZtTS5yRYmkC3p9zkH%2Fuploads%2F3AUwGHu6DpeBAd4WzTAQ%2Fimage.png?alt=media&amp;token=b5dfc5b7-aaf9-44a2-8fa3-3ad8d395a805" alt=""><figcaption></figcaption></figure>

### Add Maven Dependencies

1. Add those dependencies below into you pom.xml file

```
<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>4.12.0</version>
</dependency>
<dependency>
    <groupId>org.testng</groupId>
    <artifactId>testng</artifactId>
    <version>7.8.0</version>
    <scope>test</scope>
</dependency>
```

2\.  Set Java Compiler version 11

```xml
<properties>
    <maven.compiler.target>11</maven.compiler.target>
    <maven.compiler.source>11</maven.compiler.source>
</properties>
```

:point\_right: file pom.xml cụ thể sẽ như dưới đây:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.tvn</groupId>
    <artifactId>automation</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>7.8.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>4.12.0</version>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.13.0</version>
        </dependency>

    </dependencies>
</project>
```
