netease / dagger Goto Github PK
View Code? Open in Web Editor NEWThis project forked from chenkan/dagger
a Web UI autotest framework based on Selenium and TestNg
License: Other
This project forked from chenkan/dagger
a Web UI autotest framework based on Selenium and TestNg
License: Other
mouseOver()
这个API暂不支持Firefox,须改进一下
1.导入import org.openqa.selenium.WebDriverBackedSelenium后报错,已经把selenium jar导入。
2.导入源码到eclipse中,是已java project导入么?
3.能给我份详细的搭建步骤么,谢谢
4.我的QQ645734136,希望能和你学习!
需求:
图像对比
,差异过大则报警录制
功能,即:可以先运行一遍用例,只保存截屏,不进行图像对比检查Started ChromeDriver
port=21028
version=18.0.1022.0
log=E:\git\Dagger\chromedriver.log
.\test\automation\proxy_launcher.cc(106): error: Value of: app_launched
Actual: 1
Expected: AUTOMATION_SUCCESS
Which is: 0
Error while awaiting automation ping from browser process
.\test\automation\proxy_launcher.cc(303): error: Value of: browser.get()
Actual: false
Expected: true
Exception in thread "main" org.openqa.selenium.WebDriverException: Unable to either launch or connect to Chrome. Please check that ChromeDriver is up-to-date. Using Chrome binary at: C:\Program Files (x86)\Google\Chrome\Application\chrome.exe (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 91.41 seconds
Build info: version: '2.39.0', revision: '14fa800511cc5d66d426e08b0b2ab926c7ed7398', time: '2013-12-16 13:18:38'
System info: host: 'GIH-D-6670', ip: '10.240.141.50', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_20'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:193)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:554)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:216)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:111)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:129)
at com.netease.dagger.BrowserEmulator.setupBrowserCoreType(BrowserEmulator.java:82)
at com.netease.dagger.BrowserEmulator.(BrowserEmulator.java:61)
at com.netease.demo.GoogleSearch.main(GoogleSearch.java:32)
As we know, the chrome's update is UNSTOPPABLE that sometimes you have to download the newest driver from here and replace the one under res
folder
如下所示,代码自动补全出来的都是arg0 arg1 arg2
之类
be.expectElementExistOrNot(arg0, arg1, arg2)
这是为什么,是我的flash应用没有编译的原因么。。。
flex automation failed to perform the following operation in time: return document.getElementById('container_app').verifyFromSelenium('','')
以下API是依靠窗口title来切换窗口的,当页面上存在多个title相同的窗口时就囧了,例如
http://114.163.com/ 和 http://114.163.com/intro title就一样
void com.netease.dagger.BrowserEmulator.selectWindow ( String windowTitle )
目前Dagger要求浏览器(Chrome/Firefox)安装在默认路径下,不然无法调用
这一点须要优化
详见这里:
chenkan#1
Phantomjs
(http://phantomjs.org/)是一个基于Javascript驱动的命令行 webkit 引擎,也即无界面的 webkit 浏览器。Phontomjs 加载网页后,提供一系列的 Javascript API 给开发者使用,包括控制DOM元素﹑CSS选择器﹑JSON﹑HTML5的Canvas和SVG;由于其拥有完善的 Javascript 解析、页面渲染功能,完全可用它来模拟一个现代浏览器在加载网页时所做的各种事情,运行速度也相当快。它可以很方便地完成各种自动化测试
:页面功能回归、 屏幕截图、网络测试(通过生成HAR)等,即便是需要登录或者用户操作的场景,Phantomjs 也可以轻松完成。在很多轻量级的测试环境下,Phantomjs 正逐渐取代 Selenium。
分隔符根据系统版本不一样返回也不一样,如果代码里面写死了/的话,mac或者Linux下面使用是用的是\方法就会报错
我觉得PageFactory方法挺不错的,可以将用例和页面元素解耦出来。是否考虑将这个方法集成到Dagger?
master分支上直接ant抛出如下异常:
BUILD FAILED
/Users/ios/git/Dagger/build.xml:24: Class not found: org.eclipse.jdt.core.JDTCompilerAdapter
提供Dagger源码Jar文件,方便大家调试代码时跟踪进去
http://selenium.googlecode.com/git/java/CHANGELOG.
2.40.0's CHANGELOG:
BTW,this problem let me mad the whole afternoon.
我下载了https://github.com/chenkan/Dagger的代码。
改了TestNg.java中的String searchBtn = "//input[@name='btnK0']";让这个元素找不到。(或者在文本认证中把true改成false)
然后直接在Eclipse里执行demo.xml,用例均失败,但是没有看到失败用例多次执行。
按理说找不到元素,应该算用例失败,按照配置应该执行多次的吧。
在eclipse里面使用ant编译时会将java.io.File读取的相对路径转换到eclipse的项目路径下运行。 prop.properties被定位到eclipse项目根目录下面了/Users/chenDoInG/Desktop/adt-bundle-mac-x86_64-20130717/eclipse/Eclipse.app/Contents/MacOS/
错误信息如下:
[testng] java.io.FileNotFoundException: prop.properties (No such file or directory)
[testng] at java.io.FileInputStream.open(Native Method)
[testng] at java.io.FileInputStream.(FileInputStream.java:120)
[testng] at java.io.FileInputStream.(FileInputStream.java:79)
[testng] at com.netease.dagger.GlobalSettings.getProperties(Unknown Source)
比如去读chromedriver文件时:
[testng] Failed to invoke @configuration method com.netease.demo.TestNg.doBeforeClass:The driver executable does not exist: /Users/chenDoInG/Desktop/adt-bundle-mac-x86_64-20130717/eclipse/Eclipse.app/Contents/MacOS/res/chromedriver_for_win.exe
Dagger 交流QQ群 414651142,欢迎大家交流和分享
dagger 有录制脚本的IDE吗?
需求:
master
分支的代码时,启动回归测试,运行若干主干用例,测试Dagger的核心APIChrome
浏览器即可被测
网站或者网页Exception in thread "main" java.lang.NoSuchMethodError: org.openqa.selenium.chrome.ChromeDriverService$Builder.usingDriverExecutable(Ljava/io/File;)Lorg/openqa/selenium/remote/service/DriverService$Builder;
at com.netease.dagger.BrowserEmulator.setupBrowserCoreType(BrowserEmulator.java:71)
at com.netease.dagger.BrowserEmulator.(BrowserEmulator.java:58)
at com.tairanchina.taihe.GoogleSearch.main(GoogleSearch.java:11)
如题,这个失败重跑应该不影响测试报告的结果吧。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.