![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
selenium_测试
chenxn001
这个作者很懒,什么都没留下…
展开
-
webDriver提供了四种类型启动browser的方式:firefox,chrome,ie,htmluint
1、启动firefox浏览器a.如果你的本地firefox是默认路径安装的话,如下方式即可启动浏览器WebDriver driver = new FirefoxDriver();driver.get("http://www.baidu.com");b.如果不是默认路径安装,需要先将firefox.exe配置到系统变量中去,如下: System.setProperty("webdriver.f...翻译 2018-03-13 14:27:16 · 757 阅读 · 0 评论 -
webdriver定位元素并打印title
package web;import java.util.List;import org.openqa.selenium.By;import org.openqa.selenium.WebDriver;import org.openqa.selenium.WebElement;import org.openqa.selenium.firefox.FirefoxDriver;publ...原创 2014-06-26 17:34:59 · 707 阅读 · 0 评论 -
webdriver打开浏览器输入selenium
package web;import org.openqa.selenium.By;import org.openqa.selenium.WebDriver;import org.openqa.selenium.WebElement;import org.openqa.selenium.firefox.FirefoxDriver;public class FindTest {p...原创 2014-06-25 18:00:55 · 408 阅读 · 0 评论 -
webdriver启动chorome浏览器
package web;import java.io.File;import java.util.concurrent.TimeUnit;import com.thoughtworks.selenium.*; import com.thoughtworks.selenium.webdriven.WebDriverBackedSelenium;import org.junit.*;imp...原创 2014-06-24 17:41:05 · 537 阅读 · 0 评论 -
webdriver启动IE浏览器_报错
报错信息:java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.ie.driver system property是因为没有找到IE浏览器(不是因为你没有安装IE,而是你的IE版本和你的电脑版本不一致),怎么办呢?1、下载IEDriverServer.exe,放...原创 2014-06-24 14:57:59 · 639 阅读 · 0 评论 -
webdriver启动firefox浏览器
package web;import java.util.concurrent.TimeUnit;import com.thoughtworks.selenium.*; import com.thoughtworks.selenium.webdriven.WebDriverBackedSelenium;import org.junit.*;import org.openqa.seleni...原创 2014-06-11 18:01:53 · 581 阅读 · 0 评论 -
如何处理Alert、confirm、prompt
例子:<html><head><title>Alert</title></head><body><input id = "alert" value = "alert" type = "button" onclick = "alert('欢迎!请按确认转载 2014-07-01 17:33:23 · 364 阅读 · 0 评论 -
小小自动化
package web;import java.util.List;import junit.framework.TestCase;import org.junit.Before;import org.junit.Test;import org.openqa.selenium.By;import org.openqa.selenium.WebDriver;import org.o...原创 2014-08-07 10:25:37 · 360 阅读 · 0 评论 -
selenium弹出框、页面跳转处理
<span style="white-space:pre"> </span>//得到当前窗口的句柄 String currentWindow = wd.getWindowHandle(); System.out.print(currentWindow); //得到所有窗口的句柄 Set<String> hand...原创 2015-01-14 14:57:43 · 2118 阅读 · 0 评论 -
webdriver打开链接新页面
html例子:点击链接,代开51网站<html><head><title>Test Popup Window</title></head><body><a id = "51" href = "http://www.51.com/" target = "_blank">Let's go!</a...原创 2014-06-30 10:28:23 · 4670 阅读 · 0 评论