Self_java + Selenium + Maven Environment setup Steps

Source: Internet
Author: User
Tags seleniumhq testng

Transferred from: http://www.jianshu.com/p/3c05e8c9ee81

We use Java+selenium webdriver to build the environment, which is also divided into two parts:

    1. Installing Java and IntelliJ idea
    2. Files introduced by Maven using the specified selenium pom.xml

Mavenis a tool for project building that conveniently manages the life cycle of a project. At the same time, Maven is not just a simple project building tool, but also a dependency management tool and project information management tool. It provides a central repository that can help us to download the build automatically.

Standard installation Steps

  1. Select the Java version and install Java 1.8

  2. Create a new project with idea

    • New Project | Maven Project

      • GroupIdorg.seleniumhq.selenium
      • ArtifactId:selenium-parent
      • Version:2.53.1
    • Copy the contents of the following XML file selenium-pom.xml into the pom.xml

      <?xml version="1.0" encoding="UTF-8"?><ProjectXmlns:xsi="Http://www.w3.org/2001/XMLSchema-instance"xmlns="http://maven.apache.org/POM/4.0.0"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><Parent><Groupid>org.seleniumhq.selenium</Groupid><Artifactid>selenium-parent</Artifactid><version>2.53.1</Version></Parent><Artifactid>selenium-server</Artifactid><Name>selenium-server</Name><Dependencies><Dependency><Groupid>org.seleniumhq.selenium</Groupid><Artifactid>selenium-java</Artifactid><Version>${project.version}</Version></Dependency><Dependency><Groupid>org.seleniumhq.selenium</Groupid><Artifactid>selenium-remote-driver</Artifactid><Version>${project.version}</Version></Dependency><Dependency><Groupid>commons-io</Groupid><Artifactid>commons-io</Artifactid></Dependency><Dependency><Groupid>org.apache.commons</Groupid><Artifactid>commons-exec</Artifactid></Dependency><Dependency><Groupid>org.testng</Groupid><Artifactid>testng</Artifactid><version>6.8</version> </dependency> </dependencies> <build> < resources> <resource> <directory>src/main/resources</  directory> </resource> </resources> </build></  project>                 

      ?

Getting Started with Webdriver

Before using Webdriver, we need to do some background learning of the language first. It mainly includes object-oriented concept, basic use of Python and several parts of basic Java usage.

    • Object-oriented philosophy

      Classes, class, refers to a template, a design template.

      • Object : An object is an instance of a class, with 状态 and 行为 . For example, a panda is an object whose state is: name, age, gender, behavior: selling, eating bamboo, etc.

        • 状态: Member variables
        • 行为: Method
      • class : A class is a template, a drawing, which describes the behavior and state of a class of objects, the template or drawing is implemented, is an object.

    • Use of Python

      The Pycharm tool is a Python programming tool, and the .py file is a python extension.

      Python files are xxx_xxx.py named in the same way, the words are all lowercase, and the middle underline is added.

      For Python learning, you can refer to the following two courses:

      • Getting started with Python, http://www.imooc.com/learn/177
      • Python Advanced, http://www.imooc.com/learn/317
    • Use of Java

      The IntelliJ Idea tool is a programming tool for Java.

      Java files are XxxYyy.java named with the Big Camel, the first letter of the word capitalized.

      For Java learning, you can refer to the following two courses:

      • Introduction to Java first season, http://www.imooc.com/learn/85
      • Introduction to Java second season, http://www.imooc.com/learn/124

Self_java + Selenium + Maven environment Setup steps

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.