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')]")
})

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.