1.开发环境:

a:安装jdk,配置java的环境变量

b:安装eclipse 工具、火狐浏览器(低版本)

2.下载selenium包

selenium-java-2.44.0.jar

selenium-server-standalone-2.45.0.jar

selenium-java-2.44.0-srcs.jar

3.打开eclipse ,将selenium包导入

4.再编写代码

import java.sql.Time;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.*;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.server.browserlaunchers.Sleeper;

public class webdriverdemo {

public static void main(String[] args) {

  System.setProperty("webdriver.firefox.bin", "D:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe");
  WebDriver driver = new FirefoxDriver();
  driver.get("https://www.baidu.com");

  WebElement text = driver.findElement(By.name("mobile"));
  text.sendKeys("百度");
  Sleeper.sleepTightInSeconds(1);
  text.submit();
}

}

编写完后运行,能运行访问就ok了

自动化测试selenium+java 环境搭建的更多相关文章

  1. Selenium Web 自动化 - Selenium(Java)环境搭建

    Selenium Web 自动化 - Selenium(Java)环境搭建 2016-07-29 1 下载JDK JDK下载地址:http://www.oracle.com/technetwork/j ...

  2. 自动化测试【Maven+Eclipse+Selenium+Java环境搭建和测试】

    一.下载必要的文件 1.eclipse Eclipse官网 2.jdk jdk官网 3.selenium IDE.Selenium Server.Selenium Client Drivers(Jav ...

  3. Selenium+Java环境搭建

    1. 安装JDK URL:http://www.oracle.com/technetwork/java/javase/downloads/ 2. 配置环境变量 JAVA_HOME = E:\Java\ ...

  4. selenium webdriver 环境搭建--java

    selenium java环境的安装可以分为三个部分:jdk.eclipse和selenium. jdk jdk(java development kit)是sun公司针对java开发人员的产品,是整 ...

  5. 自动化测试基础篇--Selenium Python环境搭建

    学习selenium python需要的工具: 1.浏览器 2.Python 3.Selenium 4.FireBug(Firefox) 5.chromedriver.IEDriverServer.g ...

  6. 引用 自动化测试基础篇--Selenium Python环境搭建

    原文链接:https://www.cnblogs.com/sanzangTst/p/7452922.html 鸣谢参藏法师. 学习selenium python需要的工具: 1.浏览器 2.Pytho ...

  7. selenium Grid2环境搭建和基本使用

    Selenium Grid简介 利用Selenium Grid可以使主节点(hub)的测试用例在不同主机即分支点(node)运行.可以使一份测试用例在不同环境下(操作系统.浏览器)执行自动化测试.Se ...

  8. Selenium Java环境配置

    Selenium Java环境配置 上次配置的是C#的环境,今天主要来配置一下Java环境. 首先,对于java环境配置最基础的JDK和JRE 先前我做过配置,这里就不重述了,网上的教程超级多.在基础 ...

  9. selenium测试环境搭建(一)

    selenium测试环境搭建 下载资源 1.  selenium-java-2.53.0.zip 下载地址:http://pan.baidu.com/s/1dFDf27Z 2. Firefox Set ...

随机推荐

  1. 探索javascript----有关数组的常用方法

    与字符串的转换: str.split(","):将一个字符串以为英文逗号分割,返回一个数组: arr.join(","):返回用指定分隔符间隔的含所有数组元素的 ...

  2. Opencv 2.4.10 +VS2010 项目配置记录

    http://blog.csdn.net/scottly1/article/details/40978625?utm_source=tuicool 因为工作需要,小小的研究一下Opencv的图像处理, ...

  3. BZOJ 4326 树链剖分+二分+差分+记忆化

    去年NOIP的时候我还不会树链剖分! 还是被UOJ 的数据卡了一组. 差分的思想还是很神啊! #include <iostream> #include <cstring> #i ...

  4. Devexpress datagrid动态添加显示指定列的gridView

    代码如下: public class DXGridControlHelper { /// <summary> /// 获取显示指定列的GridView /// </summary&g ...

  5. F - To the Max

    Given a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous s ...

  6. 根据 url请求数据

    public static JSONObject getJsonFromUrl(String url){ CloseableHttpClient httpClient = HttpClients.cr ...

  7. Opencv结构与内容

    一.Opencv的结构分类: cxcore.cv.ML(Machine Learning).HighGUI.cvcam.cvaux 二.常见结构的内容与算法: 1.cxcore库(基本结构和算法.XM ...

  8. mysql存储过程详解(入门)

    delimiter //    #修改结束符号为// create procedure pro_wyx() /*创建存储过程*/ begin declare i int ; #定义变量 set i=1 ...

  9. UVA 10474 大理石在哪 lower_bound

    题意:找输入的数在排完序之后的位置. 主要是lower_bound 函数的使用.它的作用是查找大于或者等于x的第一个位置. #include<cstdio> #include<alg ...

  10. Install Qt creator

    download qt for linux yum install dialog move download qt file(qt-opensource-linux-x64-5.6.0.run) fr ...