自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(0)
  • 资源 (91)
  • 收藏
  • 关注

空空如也

JAVA获取项目路径.doc

利用System.getProperty()函数获取当前路径: System.out.println(System.getProperty("user.dir"));//user.dir指定了当前的路径

2012-08-09

chromedriver_linux64_20.0.1133.0.zip

ChromeDriver 是一款以 Google Chrome 为环境测试网站的工具,现已实现对开源的 WebDriver 通路协议的支持,因此可以轻松与现有的 WebDriver 测试工具相整合。不熟悉 WebDriver 的用户可以参考 2009 年的项目发布介绍。简而言之,WebDriver 提供基于对象的 API,可以以真实用户的视角测试 web 应用,如点击页面中的元素,或是在文本框中输入内容。

2012-08-09

chromedriver_linux32_20.0.1133.0.zip

ChromeDriver 是一款以 Google Chrome 为环境测试网站的工具,现已实现对开源的 WebDriver 通路协议的支持,因此可以轻松与现有的 WebDriver 测试工具相整合。不熟悉 WebDriver 的用户可以参考 2009 年的项目发布介绍。简而言之,WebDriver 提供基于对象的 API,可以以真实用户的视角测试 web 应用,如点击页面中的元素,或是在文本框中输入内容。

2012-08-08

chromedriver_linux64_21.0.1180.4.zip

ChromeDriver 是一款以 Google Chrome 为环境测试网站的工具,现已实现对开源的 WebDriver 通路协议的支持,因此可以轻松与现有的 WebDriver 测试工具相整合。不熟悉 WebDriver 的用户可以参考 2009 年的项目发布介绍。简而言之,WebDriver 提供基于对象的 API,可以以真实用户的视角测试 web 应用,如点击页面中的元素,或是在文本框中输入内容。

2012-08-08

chromedriver_linux32_21.0.1180.4.zip

ChromeDriver 是一款以 Google Chrome 为环境测试网站的工具,现已实现对开源的 WebDriver 通路协议的支持,因此可以轻松与现有的 WebDriver 测试工具相整合。不熟悉 WebDriver 的用户可以参考 2009 年的项目发布介绍。简而言之,WebDriver 提供基于对象的 API,可以以真实用户的视角测试 web 应用,如点击页面中的元素,或是在文本框中输入内容。

2012-08-08

chromedriver_win_20.0.1133.0.zip

ChromeDriver 是一款以 Google Chrome 为环境测试网站的工具,现已实现对开源的 WebDriver 通路协议的支持,因此可以轻松与现有的 WebDriver 测试工具相整合。不熟悉 WebDriver 的用户可以参考 2009 年的项目发布介绍。简而言之,WebDriver 提供基于对象的 API,可以以真实用户的视角测试 web 应用,如点击页面中的元素,或是在文本框中输入内容。

2012-08-08

webdriver实现浏览器窗口的最大化.docx

用webdriver调用浏览器时,有时浏览器窗口不是总是最大化的状态,可以封装一个函数实现浏览器窗口的最大化。 下面给出一个具体实例: public class IeDriver { public static void main(String[] args) { System.setProperty("webdriver.chrome.driver","C:/Program Files/Chrome WebDriver/chromedriver.exe"); WebDriver wd=new ChromeDriver(); maximise(wd); wd.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS); wd.get("http://www.baidu.com"); } //使窗口最大化函数 public static void maximise(WebDriver driver) { final JavascriptExecutor js = (JavascriptExecutor) driver; js.executeScript("window.open('','testwindow','width=400,height=200')"); driver.close(); driver.switchTo().window("testwindow"); js.executeScript("window.moveTo(0,0);"); /*1280和1024分别为窗口的宽和高,可以用下面的代码得到 screenDims = Toolkit.getDefaultToolkit().getScreenSize(); width = (int) screenDims.getWidth(); height = (int) screenDims.getHeight(); */ js.executeScript("window.resizeTo(1280,1024);"); System.out.println(Toolkit.getDefaultToolkit().getScreenSize().getWidth()); System.out.println(Toolkit.getDefaultToolkit().getScreenSize().getHeight()); } }

2012-08-08

Selenium-webdriver系列教程.doc

用户指南介绍Selenium, 讲授它的功能, 和提供常用的、由Selenium社区积累的最佳实践。 提供了许多示例。 同样,提供有关Selenium内部结构的技术信息,和Selenium的推荐使用方法。

2012-08-07

建立Selenium工程.docx

本文将step by step的讲述第一个selenium实例: step1:下载selenium-remote-control.下载地址:http://www.openqa.org/selenium-rc/download.action step2:打开eclipse 新建java project. step3:将junit.jar,selenium-remote-control-0.9.0/selenium-java-client-driver 以及selenium-remote-control-0.9.0/server/selenium-server添加至新建项目的编译路径下. step4:新建Testgoogle.java,代码如下. package test; import junit.framework.TestCase; import com.thoughtworks.selenium.DefaultSelenium; import com.thoughtworks.selenium.Selenium; public class TestGoogle extends TestCase { private Selenium selenium; public void setUp() throws Exception{ String url="http://www.google.cn"; selenium=new DefaultSelenium("localhost",4444, "*firefox", url); System.out.println("init selenium"); selenium.start(); System.out.println("start successfully"); } public void tearDown() throws Exception{ selenium.stop(); } public void testGoogleTestSearch() throws Throwable { System.out.println("enter testGoogleTestSearch"); selenium.open("/"); System.out.println("open the google.com"); selenium.type("q", "selenium"); System.out.println("input type condition"); selenium.click("btnG"); System.out.println("begin search"); selenium.waitForPageToLoad("30000"); assertTrue(selenium.isTextPresent("s")); System.out.println("finsh assert"); } } step5:右键选择testGoogle.java,选择run as junit. 看到junit的绿色通过提示条. remark:1.firefox的安装路径为默认路径,如果为非默认路径安装,需要把firefox.exe的路径写入环境变量path中. 2 出现location.href权限不足错误,在url路径后加"/",另外要确保你的浏览器能够打开www.google.com. 本文代码中用了www.google.cn,因为本人浏览器中会自动跳转到cn,而不是com.selenium在录制时候, 这种跳转对应关系录制不到.

2012-08-05

Selenium IDE测试ExtJs一种测试解决办法.docx

最近发现要使用ExtJs测试其实很麻烦,因为ExtJs的id是变化的,而Selenium IDE录制完后,ExtJs的下次打开页面,就无法进行回放了。因此很麻烦,不过通过一些网友进行交流得到如下一些测试方法:

2012-08-04

Selenium2.0之WebDriver学习总结.docx

这一部分将介绍一下WebDriver的一些具体操作和命令,实际操作中,我们需要两大工具来帮助我们:FireBug和Xpath工具,这两者都是Firefox上的插件。接下来我们所讲解的都是以FirefoxDriver为基础的,且基于WebDriver driver = new FirefoxDriver();创建的一个driver实例:

2012-08-04

selenium中storeText与storeValue使用.docx

storeText存储变量值,然后verifyText 检验表格二的数据是否等于变量(判断A的数据值是否等于B的数据值)

2012-08-04

webdriver右键action.contextClickelement.docx

webdriver下 如何模拟右键菜单操作?action.contextClick(element)命令可实现鼠标右键点击操作,例如: Actions action = new Actions(driver) ; action.contextClick(driver.findElement(By.xpath("//div/li/div/a/span"))).perform(); PS: .perform()要记得。 尝试用selenium2.0整合的webdirver.用element.sendKeys方法

2012-08-04

webdriver下定位frame和alert .docx

一.Junit中如何定位frame: SeleniumIDE中录制的selectFrame、selectWindow命令在Junit中不支持,那么只能使用webdriver自带的命令,如下列: 1.定位到一个frame driver.switchTo().frame("menuFrame"); 2.从一个frame切换到另一个frame,如:在PageA画面上click查询按钮,popup查询窗口,有时需要在这两个窗口之间进行切换 //定位到popup driver.switchTo().frame("win_queryWin_frame"); //将焦点从popup定位到PageA driver.switchTo().defaultContent();//这一句是关键 driver.switchTo().frame("bodyFrame"); 二.Junit中如何捕获Alert SeleniumIDE中录制的alert命令在Junit中不支持,那么只能使用webdriver自带的命令,如下例: //check alert 你确定要删除吗 ?? driver.switchTo().alert(); assertEquals("你确定要删除吗 ??",driver.switchTo().alert().getText()); //确认删除 driver.switchTo().alert().accept(); //取消删除 driver.switchTo().alert().dismiss();

2012-08-04

再谈Selenium测试之精要.docx

在进行selenium录制的时候,会出现一些ID是变得的。因此在经过和编程人员的协商后,决定在Ext Designer编写ExtJs的时候设置好ID。因此基本上所有发布的ExtJs源码是有固定的ID的。 经过反复的selenium录制和使用firefox的Firebugs插件的定位。得出以下结论。Ext Designer生成的ExtJs代码中的一些控件,其实是包含在一些table或者div里面的。因此更为精确的定位该控件可以使用Xpath来进行。

2012-08-04

chromedriver_win_22_0_1203_0b.zip

下载后,将文件解压放在某一目录下,如C:\Program Files\Chrome WebDriver\chromedriver.exe, 在java程序中添加 System.setProperty("webdriver.chrome.driver","C:/Program Files/Chrome WebDriver/chromedriver.exe"); WebDriver wd=new ChromeDriver(); 这样,ChromeDriver就可以顺利打开了。

2012-08-04

webdriver_backed_formatters

Adds WebDriver backed Selenium formatters, which allows users to take advantage of WebDriver without having to modify their tests to use the new API.

2012-08-04

Selenium中使用XPath.docx

由以上表格可见,在IE下使用了Cybozu Lab的XPath library后,执行效率有了很大提升,基本上可以与使用Dom定位器相当。通过比较,在新的项目中使用Selenium来进行Web自动化开发,使用XPath定位器,可以使得定位器本生比较简洁,而且也得到较高执行效率。 在Web开发中,有较多的人使用CSS来优化Web页面效果。而Selenium也支持CSS定位器,在IE和Firefox浏览器下,使用CSS定位器时,执行的效率与XPath基本相当,而且CSS定位器同样与XPath比较简洁。所以对CSS比较熟悉的开发人员也可以使用CSS定位器来进行Selenium Web自动化开发。 终上所述,在新的Web自动化项目中推荐使用XPATH和CSS定位器

2012-08-04

javascript-xpath-latest.js

1. 更换默认的xpath库 除了ie,其他主要浏览器都是内置对xpath的支持的,但ie不行,所以selenium 使用了javascript库,默认使用的是ajaxslt,这个会比较慢,可以换成 javascript-xpath, 虽然比firefox还是慢,但也快多了,上面的例子只需要不 到1秒。换法很简单,如下: selenium = new DefaultSelenium(location, port, browser, targetPath); selenium.start(); selenium.useXpathLibrary("javascript-xpath"); 2.写xpath时,尽量从一个具有id的元素开始,这样也可以大大提高执行速度,例如 如果上面的测试写成下面这样,运行时间就会变成几秒了。 assertTrue(selenium.isElementPresent("//div[1]/table/tbody/tr[2]/td[2]"));

2012-08-04

selenium-ide-1.9.0

Selenium IDE是Firefox的一个插件,是可以进行脚本录制以及案例转换,所以Selenium IDE+Firebug会成为你日后写测试案例的两大助手(IE下可以使用Selenium Core+IEDevelperToolBar)。

2012-08-03

使用selenium测试showModalDialog模态对话框

Selenium目前没有提供对IE模态对话框(即通过showModalDialog方法打开的弹出对话框)的处理。原因在于,模态对话框会将父页面的 JS挂起,直至对话框处理完毕才会继续执行父页面JS。因为Selenium的底层实现是基于JS的,所以模态对话框会同时将selenium挂 起,selenium无法选中模态对话框,直至超时。

2012-08-03

firebug-1.10.1-fx.xpi

在经过了12个alpha以及4个beta版本后,Firebug团队终于发布了Firebug 1.10正式版,兼容Firefox 13~16版本。

2012-08-03

Mozilla Firefox.zip

火狐推出了全新的网络安装包,让您在下载和安装时就能更加方便的进行功能选择和定制。快来下载、安装吧!

2012-08-03

ruby-1.9-stable.tar.gz

As an added convenience for Windows users, we’ve made available the Ruby Core and Standard Library documentation in Compiled HTML Help (CHM) format.

2012-08-02

开机需要按F1才能进入系统,如何取消开机按F1

总结:不检测软驱、更换BIOS电池、重新插拔键盘和鼠标是解决开机按F1才能进入系统最常用的方法,开机按F1的解决方法其实很简单,如果出现的症状不在本文描述中,你完全可以将系统提示的英文抄下来在进行翻译,就能很准确的知道开机按F1才能进入系统的问题所在了。

2012-10-09

windows自动登录

Xp自动登录 “开始→运行”输入control userpasswords2 然后进入“用户账户”操作窗口 取消对“要使用本机,用户必须输入用户名及密码”项的选择。在接下来弹出的对话框中输入你想让电脑每次自动登录的账户名及其密码。 单击开始→运行,输入"rundll32 netplwiz.dll,UsersRunDll"(不带引号),然后在User Accounts中取消"Users must enter a user name and password to usethis computer",单击"OK",接着在弹出的对话框中输入你想自己登陆的用户名和密码即可。

2012-10-09

用expect 实现切换用户时自动输入密码.txt

昨天一个网友问如何能够将输入密码的工作在shell里面自动完成,研究了一下,发现这种交互式的工作,普通的shell实现不了,据说可以借助expect来搞定,所以初步学习了一下expect,成果和大家分享一下: 应用一: 实现从普通用户“test”切换到root用户,自动输入root的密码,不用在终端提示符下执行密码输入操作。 步骤: (1)vi autosu.sh (2)#! /usr/bin/expect -f //指定expect工具的路径,如果不清楚具体路径,可以用"which expect"命令来查看。 spawn su - // 在expect 中用"spawn"关键字来调用命令“su - ” expect ":" //在执行了su - 命令之后,提示输入密码的提示符。例如你在执行了su - 命令之后,终端里面会出现提示“口令:”,那么你就可以在这里写expect ":",或者expect -exact "口令:" send "rootpasswd\r" //这里expect用send将你的root密码自动输入到上面的提示符之后。 interact //操作完成。 注意:这里强调一下执行脚本时要注意的地方,不能按照习惯来用sh ***.sh来这行expect的程序,会提示找不到命令,因为expect用的不是bash所以会报错。执行的时候直接./***.sh就可以了。~切记! 应用二: 从普通用户切换到root之后,执行“ls”操作,调用执行aaa.sh,返回执行结果,间隔10S。 #/usr/bin/expect -f spawn su - // 在expect 中用"spawn"关键字来调用命令“su - ” expect ":" //在执行了su - 命令之后,提示输入密码的提示符。例如你在执行了su - 命令之后,终端里面会出现提示“口令:”,那么你就可以在这里写expect ":",或者expect -exact "口令:" send "rootpasswd\r" //这里expect用send将你的root密码自动输入到上面的提示符之后。 expect "#" //当遇到提示符以#结尾时,即为root权限时; send "ls\r" //expect 用spend方法调用ls 命令,并且回车(“\r”) expect "#" send "sh aaa.sh\r" //调用sh aaa.sh,即执行一个脚本文件aaa.sh。 expect "#" send "echo $?\r" sleep 10 interact

2012-09-03

ganymed-dist-1.3.zip

The zip includes the source code for the central parts of the Ganymed prototype system. There is also a manual that describes how to setup the system.

2012-09-01

ganymed-ssh2-build251beta1.zip

Ganymed SSH-2 for Java is an open source library which implements the SSH-2 protocol in pure Java (tested on J2SE 1.4.2 and 5.0). It allows one to connect to SSH servers from within Java programs. It supports SSH sessions (remote command execution and shell access), local and remote port forwarding, local stream forwarding, X11 forwarding, SCP and SFTP. There are no dependencies on any JCE provider, as all crypto functionality is included. Originally, Ganymed SSH-2 for Java was developed for the Ganymed replication project at ETH Zurich (Switzerland). Ganymed SSH-2 for Java is the de-facto standard for open source based SSH communication in Java software. The library is used in many industrial products but also in open source software, e.g., in the widely used SVN plugin for Eclipse and in Cyberduck (a popular SFTP client for the Mac). When I start program XYZ with putty (or openssh, ..., whatever) then everything works. However, if I use "Session.execCommand", then XYZ behaves differently or does not work at all! Short answer: The most often source of problems when executing a command with Session.execCommand() are missing/wrong set environment variables on the remote machine. Make sure that the minimum needed environment for XYZ is the same, independentely on how the shell is being invoked. Example quickfix for bash users: Define all your settings in the file ~/.bashrc Make sure that the file ~/.bash_profile only contains the line source ~/.bashrc. Before executing Session.execCommand(), do NOT aquire any type of pseudo terminal in the session. Be prepared to consume stdout and stderr data. Note: If you really want to mimic the behavior of putty, then don't use Session.execCommand(), instead aquire a pty (pseudo terminal) and then start a shell (use Session.requestPTY() and Session.startShell()). You then have to communicate with the shell process at the other end through stdin and stdout. However, you also have to implement terminal logic (e.g., escape sequence handling (unless you use a "dumb" pty), "expect-send" logic (output parsing, shell prompt detection), etc.). Long answer: If you login by using putty, then putty will normally request a "xterm" pty and your assigned shell (e.g., bash) will be started (a so called "interactive login shell"). In contrast, if you use Session.execCommand() to start a command then (unless you ask for it) no pty will be aquired and the command will be given to the shell as an argument (with the shell's "-c" option). The way a shell is being invoked has an effect on the set of initialization files which will be read be the shell. To demonstrate the difference, try the following (from the command line, e.g., with an OpenSSH client): Login interactively and print the environment with the "env" command: [user@host ~] ssh 127.0.0.1 [user@host ~] env Let the ssh server execute the "env" command (equivalent to using Session.executeCommand()): [user@host ~] ssh 127.0.0.1 "env" If you compare the two outputs, then you will (unless you have adjusted your shell's settings) observe different environments. If you are interested in the details, then please read the INVOCATION section in man page for the bash shell. You may notice that the definitions of "interactive" and "non-interactive" (and combinations with "login") are little bit tricky.

2012-09-01

联想ThinkPad E530 网卡驱动

联想ThinkPad E530 网卡驱动,联想驱动自动安装工具仅用于确定您的Lenovo产品,以帮助您更快速准确的定位驱动。 不需要、也不会访问您计算机上的任何个人或私人数据。

2012-09-01

Java调用Windows批处理.docx

 有时候,JAVA程序需调用本地的批处理进行一些处理,下面的代码就演示了如何在JAVA中调用本地的批处理文件

2012-08-15

Python-3.2.3.tar.bz2

Note: Barry's key id EA5BBD71 is used to sign all Python 2.6 and 3.0 releases. His key id ED9D77D5 is a v3 key and was used to sign older releases. You can import the release manager public keys by either downloading the public key file from here and then running % gpg --import pubkeys.txt or by grabbing the individual keys directly from the keyserver network by running this command: % gpg --recv-keys EA5BBD71 6A45C816 ED9D77D5 \ 7D9DC8D2 A4135B38 36580288 On the version-specific download pages, you should see a link to both the downloadable file and a detached signature file. To verify the authenticity of the download, grab both files and then run this command: % gpg --verify Python-3.2.3.tgz.asc

2012-08-14

python-3.2.3.msi

Note: Barry's key id EA5BBD71 is used to sign all Python 2.6 and 3.0 releases. His key id ED9D77D5 is a v3 key and was used to sign older releases. You can import the release manager public keys by either downloading the public key file from here and then running % gpg --import pubkeys.txt or by grabbing the individual keys directly from the keyserver network by running this command: % gpg --recv-keys EA5BBD71 6A45C816 ED9D77D5 \ 7D9DC8D2 A4135B38 36580288 On the version-specific download pages, you should see a link to both the downloadable file and a detached signature file. To verify the authenticity of the download, grab both files and then run this command: % gpg --verify Python-3.2.3.tgz.asc

2012-08-14

python-3.2.3.amd64.msi

Note: Barry's key id EA5BBD71 is used to sign all Python 2.6 and 3.0 releases. His key id ED9D77D5 is a v3 key and was used to sign older releases. You can import the release manager public keys by either downloading the public key file from here and then running % gpg --import pubkeys.txt or by grabbing the individual keys directly from the keyserver network by running this command: % gpg --recv-keys EA5BBD71 6A45C816 ED9D77D5 \ 7D9DC8D2 A4135B38 36580288 On the version-specific download pages, you should see a link to both the downloadable file and a detached signature file. To verify the authenticity of the download, grab both files and then run this command: % gpg --verify Python-3.2.3.tgz.asc

2012-08-14

java识别验证码.docx

在Eclipse中处理图片,需要引入两个包: import com.sun.image.codec.jpeg.JPEGCodec; import com.sun.image.codec.jpeg.JPEGImageEncoder; 报错: Access restriction: The type JPEGImageEncoder is not accessible due to restriction on required library C:\Java\jre1.6.0_07\lib\rt.jar 此时解决办法: Eclipse默认把这些受访问限制的API设成了ERROR。只要把Windows-Preferences-Java-Complicer-Errors/Warnings里面的Deprecated and restricted API中的Forbidden references(access rules)选为Warning就可以编译通过。

2012-08-12

Asprise-OCR-Java-Windows_Vista_64bit-4.0.zip

Asprise OCR v4.0 provides full support for Windows Vista, and most of 64bit operating systems. Additionally, Asprise OCR v4.0 features optimized OCR engine with higher accuracy and faster speed.

2012-08-12

Asprise-OCR-Java-Windows_Vista_32bit-4.0.zip

Asprise OCR v4.0 provides full support for Windows Vista, and most of 64bit operating systems. Additionally, Asprise OCR v4.0 features optimized OCR engine with higher accuracy and faster speed.

2012-08-12

Java 验证码识别工程.zip

高效率的Java 验证码识别引擎,推荐使用于网页验证码,使用方法:下载解压后,导入Eclipse或MyEclipse中,然后在c:盘下放置一张验证码图片(如:test.bmp),然后运行ParseJPEG_withOCR类的main方法即可!

2012-08-12

selenium.txt

http://qi-ling2006.iteye.com/blog/1534816 http://jarvi.iteye.com/category/203994 http://nbkhic.iteye.com/category/162711 http://www.oracle.com/technetwork/java/javase/downloads/index.html

2012-08-07

selenium webdriver学习.zip

WebDriver针对各个浏览器而开发,取代了嵌入到被测Web应用中的JavaScript。与浏览器的紧密集成支持创建更高级的测试,避免了JavaScript安全模型导致的限制。除了来自浏览器厂商的支持,WebDriver还利用操作系统级的调用模拟用户输入。WebDriver支持Firefox (FirefoxDriver)、IE (InternetExplorerDriver)、Opera (OperaDriver) 和Chrome (ChromeDriver)。对Safari的支持由于技术限制在本版本中未包含,但是可以使用SeleneseCommandExecutor模拟。它还支持Android (AndroidDriver)和iPhone (IPhoneDriver) 的移动应用测试。它还包括一个基于HtmlUnit的无界面实现,称为HtmlUnitDriver。WebDriver API可以通过Python、Ruby、Java和C#访问,支持开发人员使用他们偏爱的编程语言来创建测试。

2012-08-07

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除