Coder Social home page Coder Social logo

linuxsuren / phoenix.webui.framework Goto Github PK

View Code? Open in Web Editor NEW
120.0 24.0 61.0 9.93 MB

基于WebDriver的WebUI自动化测试框架

Home Page: https://github.com/LinuxSuRen/phoenix.webui.framework

License: Apache License 2.0

Java 99.67% AutoIt 0.12% Groovy 0.13% Makefile 0.07%
selenium test autotest eclipse xml phoenix xsd webdriver automation automation-framework

phoenix.webui.framework's Introduction

License Maven Central

该项目不再维护,如果您对接口开发、调试、测试工具感兴趣的话,请关注我的另外一个开源项目 api-testing

PhoenixAutoTest

本项目是一个基于 Selenium 的Web自动测试框架,通过该框架可以简化测试人员的学习难度,只要 编写少量的Java代码即可,大多数的工作都是编写页面元素的描述文件以及对应的数据源。以下是本框架的特色:

  • 支持多种元素选择策略(优先级、循环、区域)
  • 支持多种数据源yamlexcel
  • 支持包括:HTMLExcelJira数据库等格式的测试报告输出
  • 支持数据源、URL、元素定位信息的参数化
  • 支持密文数据,javascript、groovy、freemarker等动态脚本数据
  • 支持动态生成日期、身份证号码、手机号、邮编等数据
  • 支持操作日志生成GIF动态图片
  • 支持主流的浏览器(ie、firefox、chrome、opera、safari)以及 headless 模式
  • 支持纯 XML 编写完成自动化测试功能
  • 自动下载 WebDriver 驱动

快速开始

你可以先下载这个示例项目,来快速地体验。

引擎配置

你可以通过引擎配置文件 engine.properties 调整框架的默认行为,支持的配置项包括:

Key 默认值 描述
engine.autoLoad true 是否自动下载 WebDriver
cookie.save false
cookie.save.path phoenix.autotest.cookie
chrome.version Chrome 浏览器版本
chrome.args.headless false
chrome.args.intl.accept_languages
chrome.args.lang 浏览器语言设置,例如:zh_CN
chrome.args.window-size= 设置浏览器窗口大小,例如:1024,768

在 Maven 项目中,该文件的位置是:src/main/resources/engine.properties。你可以从 Chrome 官方文档 查找完整的参数。

元素定位

国际化页面

对于具有国际化的前端页面,浏览器的语言不同的情况下页面元素会有不同的展示。例如:一个按钮中文时显示为:确认,英文时显示为:OK。 此时,如果我们希望通过这里的文本字符串来定位的话,可以参考下面的示例,同时提供多个定位方法,并指定语言:

@AutoLocators(strategy = StrategyType.CYLE, locators = {
    @AutoLocator(locator = LocatorType.BY_XPATH, value = "//p[contains(text(),'企业空间')]", lang = "zh-CN"),
    @AutoLocator(locator = LocatorType.BY_XPATH, value = "//p[contains(text(),'Workspaces')]")
})

phoenix.webui.framework's People

Contributors

379753498 avatar dependabot[bot] avatar gitter-badger avatar linuxsuren avatar surenpi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

phoenix.webui.framework's Issues

Doesn't compile/Relevancy

The framework, which you are posting around on un-relevant issues, doesn't compile.

A - Please stop posting this where it is not relevant.

B - Your maven server is not functioning. If you want people to use your project you need to ensure that your server is reliable enough to support artifact resolution. Consider using stable public repositories and uploading your artifacts there instead for better project stability.
image

$ mvn clean compile
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building autotest.web.framework 1.0.2-20170325
[INFO] ------------------------------------------------------------------------
Downloading: http://maven.surenpi.com/nexus/content/repositories/public/org/suren/autotest/autotest.interface.framework/0.0.1-SNAPSHOT/maven-metadata.xml
[WARNING] Could not transfer metadata org.suren.autotest:autotest.interface.framework:0.0.1-SNAPSHOT/maven-metadata.xml from/to maven.surenpi.com (http://maven.surenpi.com/nexus/content/repositories/public/): Failed to transfer file: http://maven.surenpi.com/nexus/content/repositories/public/org/suren/autotest/autotest.interface.framework/0.0.1-SNAPSHOT/maven-metadata.xml. Return code is: 502 , ReasonPhrase:Bad Gateway.
[WARNING] Failure to transfer org.suren.autotest:autotest.interface.framework:0.0.1-SNAPSHOT/maven-metadata.xml from http://maven.surenpi.com/nexus/content/repositories/public/ was cached in the local repository, resolution will not be reattempted until the update interval of maven.surenpi.com has elapsed or updates are forced. Original error: Could not transfer metadata org.suren.autotest:autotest.interface.framework:0.0.1-SNAPSHOT/maven-metadata.xml from/to maven.surenpi.com (http://maven.surenpi.com/nexus/content/repositories/public/): Failed to transfer file: http://maven.surenpi.com/nexus/content/repositories/public/org/suren/autotest/autotest.interface.framework/0.0.1-SNAPSHOT/maven-metadata.xml. Return code is: 502 , ReasonPhrase:Bad Gateway.
Downloading: http://maven.surenpi.com/nexus/content/repositories/public/org/suren/autotest/autotest.interface.framework/0.0.1-SNAPSHOT/autotest.interface.framework-0.0.1-SNAPSHOT.pom
Downloading: http://maven.surenpi.com/nexus/content/repositories/public/org/seleniumhq/selenium/selenium-support/maven-metadata.xml
[WARNING] Could not transfer metadata org.seleniumhq.selenium:selenium-support/maven-metadata.xml from/to maven.surenpi.com (http://maven.surenpi.com/nexus/content/repositories/public/): Failed to transfer file: http://maven.surenpi.com/nexus/content/repositories/public/org/seleniumhq/selenium/selenium-support/maven-metadata.xml. Return code is: 502 , ReasonPhrase:Bad Gateway.
Downloading: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/core/resources/maven-metadata.xml
[WARNING] Could not transfer metadata org.eclipse.core:resources/maven-metadata.xml from/to maven.surenpi.com (http://maven.surenpi.com/nexus/content/repositories/public/): Failed to transfer file: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/core/resources/maven-metadata.xml. Return code is: 502 , ReasonPhrase:Bad Gateway.
Downloading: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/core/runtime/compatibility/maven-metadata.xml
[WARNING] Could not transfer metadata org.eclipse.core.runtime:compatibility/maven-metadata.xml from/to maven.surenpi.com (http://maven.surenpi.com/nexus/content/repositories/public/): Failed to transfer file: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/core/runtime/compatibility/maven-metadata.xml. Return code is: 502 , ReasonPhrase:Bad Gateway.
Downloading: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/core/runtime/maven-metadata.xml
[WARNING] Could not transfer metadata org.eclipse.core:runtime/maven-metadata.xml from/to maven.surenpi.com (http://maven.surenpi.com/nexus/content/repositories/public/): Failed to transfer file: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/core/runtime/maven-metadata.xml. Return code is: 502 , ReasonPhrase:Bad Gateway.
Downloading: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/osgi/maven-metadata.xml
[WARNING] Could not transfer metadata org.eclipse:osgi/maven-metadata.xml from/to maven.surenpi.com (http://maven.surenpi.com/nexus/content/repositories/public/): Failed to transfer file: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/osgi/maven-metadata.xml. Return code is: 502 , ReasonPhrase:Bad Gateway.
Downloading: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/equinox/common/maven-metadata.xml
[WARNING] Could not transfer metadata org.eclipse.equinox:common/maven-metadata.xml from/to maven.surenpi.com (http://maven.surenpi.com/nexus/content/repositories/public/): Failed to transfer file: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/equinox/common/maven-metadata.xml. Return code is: 502 , ReasonPhrase:Bad Gateway.
Downloading: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/core/jobs/maven-metadata.xml
[WARNING] Could not transfer metadata org.eclipse.core:jobs/maven-metadata.xml from/to maven.surenpi.com (http://maven.surenpi.com/nexus/content/repositories/public/): Failed to transfer file: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/core/jobs/maven-metadata.xml. Return code is: 502 , ReasonPhrase:Bad Gateway.
[WARNING] Failure to transfer org.eclipse.equinox:common/maven-metadata.xml from http://maven.surenpi.com/nexus/content/repositories/public/ was cached in the local repository, resolution will not be reattempted until the update interval of maven.surenpi.com has elapsed or updates are forced. Original error: Could not transfer metadata org.eclipse.equinox:common/maven-metadata.xml from/to maven.surenpi.com (http://maven.surenpi.com/nexus/content/repositories/public/): Failed to transfer file: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/equinox/common/maven-metadata.xml. Return code is: 502 , ReasonPhrase:Bad Gateway.
Downloading: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/equinox/registry/maven-metadata.xml
[WARNING] Could not transfer metadata org.eclipse.equinox:registry/maven-metadata.xml from/to maven.surenpi.com (http://maven.surenpi.com/nexus/content/repositories/public/): Failed to transfer file: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/equinox/registry/maven-metadata.xml. Return code is: 502 , ReasonPhrase:Bad Gateway.
Downloading: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/equinox/preferences/maven-metadata.xml
[WARNING] Could not transfer metadata org.eclipse.equinox:preferences/maven-metadata.xml from/to maven.surenpi.com (http://maven.surenpi.com/nexus/content/repositories/public/): Failed to transfer file: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/equinox/preferences/maven-metadata.xml. Return code is: 502 , ReasonPhrase:Bad Gateway.
Downloading: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/core/contenttype/maven-metadata.xml
[WARNING] Could not transfer metadata org.eclipse.core:contenttype/maven-metadata.xml from/to maven.surenpi.com (http://maven.surenpi.com/nexus/content/repositories/public/): Failed to transfer file: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/core/contenttype/maven-metadata.xml. Return code is: 502 , ReasonPhrase:Bad Gateway.
[WARNING] Failure to transfer org.eclipse.equinox:preferences/maven-metadata.xml from http://maven.surenpi.com/nexus/content/repositories/public/ was cached in the local repository, resolution will not be reattempted until the update interval of maven.surenpi.com has elapsed or updates are forced. Original error: Could not transfer metadata org.eclipse.equinox:preferences/maven-metadata.xml from/to maven.surenpi.com (http://maven.surenpi.com/nexus/content/repositories/public/): Failed to transfer file: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/equinox/preferences/maven-metadata.xml. Return code is: 502 , ReasonPhrase:Bad Gateway.
[WARNING] Failure to transfer org.eclipse.equinox:registry/maven-metadata.xml from http://maven.surenpi.com/nexus/content/repositories/public/ was cached in the local repository, resolution will not be reattempted until the update interval of maven.surenpi.com has elapsed or updates are forced. Original error: Could not transfer metadata org.eclipse.equinox:registry/maven-metadata.xml from/to maven.surenpi.com (http://maven.surenpi.com/nexus/content/repositories/public/): Failed to transfer file: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/equinox/registry/maven-metadata.xml. Return code is: 502 , ReasonPhrase:Bad Gateway.
Downloading: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/equinox/app/maven-metadata.xml
[WARNING] Could not transfer metadata org.eclipse.equinox:app/maven-metadata.xml from/to maven.surenpi.com (http://maven.surenpi.com/nexus/content/repositories/public/): Failed to transfer file: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/equinox/app/maven-metadata.xml. Return code is: 502 , ReasonPhrase:Bad Gateway.
[WARNING] Failure to transfer org.eclipse.equinox:app/maven-metadata.xml from http://maven.surenpi.com/nexus/content/repositories/public/ was cached in the local repository, resolution will not be reattempted until the update interval of maven.surenpi.com has elapsed or updates are forced. Original error: Could not transfer metadata org.eclipse.equinox:app/maven-metadata.xml from/to maven.surenpi.com (http://maven.surenpi.com/nexus/content/repositories/public/): Failed to transfer file: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/equinox/app/maven-metadata.xml. Return code is: 502 , ReasonPhrase:Bad Gateway.
Downloading: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/update/configurator/maven-metadata.xml
[WARNING] Could not transfer metadata org.eclipse.update:configurator/maven-metadata.xml from/to maven.surenpi.com (http://maven.surenpi.com/nexus/content/repositories/public/): Failed to transfer file: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/update/configurator/maven-metadata.xml. Return code is: 502 , ReasonPhrase:Bad Gateway.
[WARNING] Failure to transfer org.eclipse:osgi/maven-metadata.xml from http://maven.surenpi.com/nexus/content/repositories/public/ was cached in the local repository, resolution will not be reattempted until the update interval of maven.surenpi.com has elapsed or updates are forced. Original error: Could not transfer metadata org.eclipse:osgi/maven-metadata.xml from/to maven.surenpi.com (http://maven.surenpi.com/nexus/content/repositories/public/): Failed to transfer file: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/osgi/maven-metadata.xml. Return code is: 502 , ReasonPhrase:Bad Gateway.
Downloading: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/core/expressions/maven-metadata.xml
[WARNING] Could not transfer metadata org.eclipse.core:expressions/maven-metadata.xml from/to maven.surenpi.com (http://maven.surenpi.com/nexus/content/repositories/public/): Failed to transfer file: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/core/expressions/maven-metadata.xml. Return code is: 502 , ReasonPhrase:Bad Gateway.
[WARNING] Failure to transfer org.eclipse.core:runtime/maven-metadata.xml from http://maven.surenpi.com/nexus/content/repositories/public/ was cached in the local repository, resolution will not be reattempted until the update interval of maven.surenpi.com has elapsed or updates are forced. Original error: Could not transfer metadata org.eclipse.core:runtime/maven-metadata.xml from/to maven.surenpi.com (http://maven.surenpi.com/nexus/content/repositories/public/): Failed to transfer file: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/core/runtime/maven-metadata.xml. Return code is: 502 , ReasonPhrase:Bad Gateway.
Downloading: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/core/filesystem/maven-metadata.xml
[WARNING] Could not transfer metadata org.eclipse.core:filesystem/maven-metadata.xml from/to maven.surenpi.com (http://maven.surenpi.com/nexus/content/repositories/public/): Failed to transfer file: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/core/filesystem/maven-metadata.xml. Return code is: 502 , ReasonPhrase:Bad Gateway.
[WARNING] Failure to transfer org.eclipse.equinox:common/maven-metadata.xml from http://maven.surenpi.com/nexus/content/repositories/public/ was cached in the local repository, resolution will not be reattempted until the update interval of maven.surenpi.com has elapsed or updates are forced. Original error: Could not transfer metadata org.eclipse.equinox:common/maven-metadata.xml from/to maven.surenpi.com (http://maven.surenpi.com/nexus/content/repositories/public/): Failed to transfer file: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/equinox/common/maven-metadata.xml. Return code is: 502 , ReasonPhrase:Bad Gateway.
[WARNING] Failure to transfer org.eclipse.equinox:registry/maven-metadata.xml from http://maven.surenpi.com/nexus/content/repositories/public/ was cached in the local repository, resolution will not be reattempted until the update interval of maven.surenpi.com has elapsed or updates are forced. Original error: Could not transfer metadata org.eclipse.equinox:registry/maven-metadata.xml from/to maven.surenpi.com (http://maven.surenpi.com/nexus/content/repositories/public/): Failed to transfer file: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/equinox/registry/maven-metadata.xml. Return code is: 502 , ReasonPhrase:Bad Gateway.
[WARNING] Failure to transfer org.eclipse:osgi/maven-metadata.xml from http://maven.surenpi.com/nexus/content/repositories/public/ was cached in the local repository, resolution will not be reattempted until the update interval of maven.surenpi.com has elapsed or updates are forced. Original error: Could not transfer metadata org.eclipse:osgi/maven-metadata.xml from/to maven.surenpi.com (http://maven.surenpi.com/nexus/content/repositories/public/): Failed to transfer file: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/osgi/maven-metadata.xml. Return code is: 502 , ReasonPhrase:Bad Gateway.
[WARNING] Failure to transfer org.eclipse.core:runtime/maven-metadata.xml from http://maven.surenpi.com/nexus/content/repositories/public/ was cached in the local repository, resolution will not be reattempted until the update interval of maven.surenpi.com has elapsed or updates are forced. Original error: Could not transfer metadata org.eclipse.core:runtime/maven-metadata.xml from/to maven.surenpi.com (http://maven.surenpi.com/nexus/content/repositories/public/): Failed to transfer file: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/core/runtime/maven-metadata.xml. Return code is: 502 , ReasonPhrase:Bad Gateway.
Downloading: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/text/maven-metadata.xml
[WARNING] Could not transfer metadata org.eclipse:text/maven-metadata.xml from/to maven.surenpi.com (http://maven.surenpi.com/nexus/content/repositories/public/): Failed to transfer file: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/text/maven-metadata.xml. Return code is: 502 , ReasonPhrase:Bad Gateway.
Downloading: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/core/commands/maven-metadata.xml
[WARNING] Could not transfer metadata org.eclipse.core:commands/maven-metadata.xml from/to maven.surenpi.com (http://maven.surenpi.com/nexus/content/repositories/public/): Failed to transfer file: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/core/commands/maven-metadata.xml. Return code is: 502 , ReasonPhrase:Bad Gateway.
[WARNING] Failure to transfer org.eclipse.equinox:common/maven-metadata.xml from http://maven.surenpi.com/nexus/content/repositories/public/ was cached in the local repository, resolution will not be reattempted until the update interval of maven.surenpi.com has elapsed or updates are forced. Original error: Could not transfer metadata org.eclipse.equinox:common/maven-metadata.xml from/to maven.surenpi.com (http://maven.surenpi.com/nexus/content/repositories/public/): Failed to transfer file: http://maven.surenpi.com/nexus/content/repositories/public/org/eclipse/equinox/common/maven-metadata.xml. Return code is: 502 , ReasonPhrase:Bad Gateway.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.736 s
[INFO] Finished at: 2017-04-03T11:42:34-06:00
[INFO] Final Memory: 9M/245M
[INFO] ------------------------------------------------------------------------

使用火狐浏览器时报错

Exception in thread "main" java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.gecko.driver syst
em property; for more information, see https://github.com/mozilla/geckodriver. The latest version can be downloaded from https://github.com/
mozilla/geckodriver/releases
at com.google.common.base.Preconditions.checkState(Preconditions.java:738)
at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:111)
at org.openqa.selenium.firefox.GeckoDriverService.access$100(GeckoDriverService.java:38)
at org.openqa.selenium.firefox.GeckoDriverService$Builder.findDefaultExecutable(GeckoDriverService.java:112)
at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:302)
at org.openqa.selenium.firefox.FirefoxDriver.toExecutor(FirefoxDriver.java:233)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:125)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:150)
at org.suren.autotest.web.framework.selenium.SeleniumEngine.init(SeleniumEngine.java:174)
at org.suren.autotest.web.framework.selenium.SeleniumEngine$$FastClassBySpringCGLIB$$655932d8.invoke()
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:718)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:653)
at org.suren.autotest.web.framework.selenium.SeleniumEngine$$EnhancerBySpringCGLIB$$6c6b64fb.init()
at org.suren.autotest.web.framework.settings.SettingUtil.parse(SettingUtil.java:440)
at org.suren.autotest.web.framework.settings.SettingUtil.read(SettingUtil.java:233)
at org.suren.autotest.web.framework.settings.SettingUtil.readFromClassPath(SettingUtil.java:185)
at sdfsf.OsChinaTest.main(OsChinaTest.java:19)

启动报错

Exception in thread "main" java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
at sun.security.util.SignatureFileVerifier.processImpl(Unknown Source)
at sun.security.util.SignatureFileVerifier.process(Unknown Source)
at java.util.jar.JarVerifier.processEntry(Unknown Source)
at java.util.jar.JarVerifier.update(Unknown Source)
at java.util.jar.JarFile.initializeVerifier(Unknown Source)
at java.util.jar.JarFile.getInputStream(Unknown Source)
at sun.misc.URLClassPath$JarLoader$2.getInputStream(Unknown Source)
at sun.misc.Resource.cachedInputStream(Unknown Source)
at sun.misc.Resource.getByteBuffer(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at glodon.jujian.test.HtmlUnitTest.main(HtmlUnitTest.java:20)

树形式编辑展示 运行方式

第一步:登录系统;
添加项目名称;
添加模块名称
添加页面名称
添加页面元素
根据元素 添加数据元素版本A (此处实现元素和数据的绑定)
根据元素 添加数据元素版本B 。。。。可选择一个版本()
根据元素数据已经添加完成-添加逻辑操作A(选择元素-选择操作)
根据元素数据已经添加完成-添加逻辑操作b(选择元素-选择操作)

勾选需要运行的页面
配置运行时需要的必要条件(浏览器 最大化 ....)
执行运行;
查看结果;
至于什么包名称 类名称 什么等等 全部隐藏 不需要进行展示 编辑
全傻瓜式操作

元素定位优化建议

对于很多表单类的元素定位,可以使用name来定位,这里如果是只关心是否必填,没有关联关系或者类型的话,是可以批量定位的

使用invoker报错

org.xml.sax.SAXParseException; lineNumber: 20; columnNumber: 83; cvc-datatype-valid.1.2.3: 'org.suren.autotest.web.framework.invoker.JsInvoker!clickByClassName' is not a valid value of union type 'invokerEnum'.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.processOneAttribute(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.processAttributes(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.jaxp.validation.StreamValidatorHelper.validate(Unknown Source)
at org.apache.xerces.jaxp.validation.ValidatorImpl.validate(Unknown Source)
at org.suren.autotest.web.framework.validation.Validation.validation(Validation.java:57)
at org.suren.autotest.web.framework.validation.Validation.validationSuite(Validation.java:97)
at org.suren.autotest.web.framework.core.suite.SuiteRunner.runFromClasspathFile(SuiteRunner.java:188)
at sdfsf.Test.hello(Test.java:27)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

使用浏览器htmlUnit时报错

Exception in thread "main" java.lang.UnsupportedOperationException: Javascript is not enabled for this HtmlUnitDriver instance
at org.openqa.selenium.htmlunit.HtmlUnitDriver.getPageToInjectScriptInto(HtmlUnitDriver.java:716)
at org.openqa.selenium.htmlunit.HtmlUnitDriver.executeScript(HtmlUnitDriver.java:665)
at org.suren.autotest.web.framework.selenium.SeleniumEngine.computeToolbarHeight(SeleniumEngine.java:854)
at org.suren.autotest.web.framework.selenium.SeleniumEngine$$FastClassBySpringCGLIB$$655932d8.invoke()
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:718)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:653)
at org.suren.autotest.web.framework.selenium.SeleniumEngine$$EnhancerBySpringCGLIB$$6c6b64fb.computeToolbarHeight()
at org.suren.autotest.web.framework.page.Page.open(Page.java:76)
at sdfsf.OsChinaTest.main(OsChinaTest.java:22)

项目形式存在问题

目前的项目形式比较繁琐展示的时候也不自然;
建议模式如图:

已发送群

在使用htmlunitdriver时报错

Exception in thread "main" org.openqa.selenium.WebDriverException: java.lang.IllegalArgumentException: Cannot locate declared field class or
g.apache.http.impl.client.HttpClientBuilder.dnsResolver
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
Driver info: driver.version: HtmlUnitDriver
at org.openqa.selenium.htmlunit.HtmlUnitDriver.get(HtmlUnitDriver.java:541)
at org.openqa.selenium.htmlunit.HtmlUnitDriver.get(HtmlUnitDriver.java:515)
at glodon.jujian.test.HtmlUnitTest.main(HtmlUnitTest.java:21)
Caused by: java.lang.IllegalArgumentException: Cannot locate declared field class org.apache.http.impl.client.HttpClientBuilder.dnsResolver
at org.apache.commons.lang3.Validate.isTrue(Validate.java:155)
at org.apache.commons.lang3.reflect.FieldUtils.readDeclaredField(FieldUtils.java:471)
at com.gargoylesoftware.htmlunit.HttpWebConnection.getField(HttpWebConnection.java:1096)
at com.gargoylesoftware.htmlunit.HttpWebConnection.createConnectionManager(HttpWebConnection.java:1019)
at com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:177)
at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1364)
at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1281)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:383)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:305)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:452)
at org.openqa.selenium.htmlunit.HtmlUnitDriver.get(HtmlUnitDriver.java:526)
... 2 more

浏览器设置为Firefox时报错

Exception in thread "main" java.lang.RuntimeException: Driver path is empty!
at org.suren.autotest.web.framework.selenium.SeleniumEngine.loadDriverFromMapping(SeleniumEngine.java:449)
at org.suren.autotest.web.framework.selenium.SeleniumEngine.loadDefaultEnginePath(SeleniumEngine.java:398)
at org.suren.autotest.web.framework.selenium.SeleniumEngine.initConfig(SeleniumEngine.java:110)
at org.suren.autotest.web.framework.selenium.SeleniumEngine.init(SeleniumEngine.java:129)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.