1.0.4 • Published 6 years ago

uiauto v1.0.4

Weekly downloads
2
License
ISC
Repository
github
Last release
6 years ago

Demo

Demo to create a github new repo

uiauto "create-github-repo.json"

alt text

Setup

npm i -g uiauto

Options

  • -f, --file Test sequence json file (defalut option)
  • -p, --parallel Parallel execution count
  • -s, --serial Serial execution count
  • -l, --headless Head less chrome
  • -t, --timeout Navigation timout
  • -n, --noquit Do not close browser once done
  • -v, --version Version

Example

  • Run one execution sequence, this is demo for creating a new github repo automatically.
uiauto "github-create-repo.json"
  • Run 5 execuation sequences in parallel
uiauto "github-create-repo.json" -p 5
  • Run one execution sequence with 5 times loop
uiatuo "github-create-repo.json" -s 5

github-create-repo.json stored the data of UI automation.

Definition of data file

{
    "description": "",
    "siteUrl": "",
    "creds": [
        {
            "username": "",
            "password": ""
        }
    ],
    "data": [
        {
            "description": "",
            "data": "",
            "interval": 2,
            "delay": 1,
            "textbox": true,
            "navigation": true,
            "ignore": true,
            "value": "",
            "cred": "username"
        }
    ]
}

Details of each field

FieldsTypeDescription
descriptionStringDescription of test sequence
siteUrlStringThe url of web site, the automation tool will run
credsArrayType of each item is object, stored data for typing
dataArrayType of each item is object, each object is an action

Details of each action field

Action FieldsTypeDescription
descriptionStringDescripton of this action
dataStringXPath, suggest to use a very details XPath, with more information more stable, such as class, id, sibiling index, text value and top to BODY. Suggest to use this Chrome extension Full XPath to copy XPath
intervalNumberTimeout of finding element by XPath, Unit: second
delayNumberThe delay time to execute this action, unit: second, default value is one second
textboxBooleanWhether the element is a textbox element, such as inputtype="text" or inputtype="password"
navigationBooleanExist a navigation after the action executed
ignoreBooleanIf do not find element by XPath, the action will be ignored
valueAnyThis field is for textbox type element, it will be convered when cred filed is exist
credStringits value is the key of creds above, it's for textbox type element

Why use a full XPath

Using a ful XPath with more details(class, id, sibiling index, text value) and top to BODY. Because used a dynamica locating a algorithm, which help to resolve XPath break when page changed, for example, the position of parent or brother elements is changed. The sytle changed such as class name updated.

Support JavaScript expression

All fields support to JavaScript expression, for example:

Set delay as 60-160 seconds

"delay": "{ 60 + Math.ceil(Math.random()*100) }"
1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago