使用vanilla/python编写的简单robotframework关键字库
robojslib的Python项目详细描述
robotjslib
如何使用
使用pip安装:
安装pip并运行:
pip install robojslib
手动安装:
下载robojslib.py并将其放在python脚本文件夹或tests.robot文件夹中。 完成后,通过运行
Library robotJSlib.py
依赖项:
运行之前,请确保已安装依赖项:
pip install robotframework-seleniumlibrary
pip install robotframework
对于内置库
Keyword | arguments | Info | ||
---|---|---|---|---|
Check title | None | Checks driver title to not include "http" | ||
Vanilla click | Element ID | Uses vanillaJS to trigger a click overan element | ||
Vanilla click by query selector | Selector | Uses vanillaJS to trigger a click overan element | ||
Modify url string | "arg1, arg2": Url portion to be changed, url portion to be injected | checks if a url sub-string is available and substitute it with second argument | ||
Vanilla input | "arg1, arg2" Element ID, value | Vanilla input on a given element with the given text | ||
Vanilla input by query selector | "arg1, arg2" selector, value | Vanilla input on a given element with the given text | ||
Checkbox control | Element ID | If checkbox is selected it skips, else it clicks it | ||
Insert phone nr | Element ID | generates a phone nr (es: 351xxxxxxx) & inputs the value inside the element | ||
Set responsive | Mobile, Tablet | sets resolution for responsive testing: Mobile or Tablet | ||
Wait until title contains | arg, string be contained | Checks title contains a given string | ||
Open new tab | arg: "url to be opened" | Note: include "http" or "https" in the url to avoid any bug/problem | ||
Check if visible and click | arg: id | Checks if an element is displayed and clicks it. Otherwise, it skips. | ||
Check if visible and click by class | arg: class | Checks if an element by class is displayed and clicks it. Otherwise, it skips. | ||
Check if visible and click by css selector | arg: css selector | Checks if an element by css selector is displayed and clicks it. Otherwise, it skips. |