如何在机器人框架内运行sikuli脚本? [英] How to run sikuli script inside robot framework?
问题描述
我已经使用sikuli自动化了以下场景:
I have automated the following scenario using sikuli:
STEP 1: Launch a application by clicking on icon in windows desktop
STEP 2: Input Username
STEP 3: Input Password
STEP 4: Click Launch button.
它按预期工作.
现在,我想使用Robot Framework来运行它,以便可以将所有其他工作与此集成.
Now I am want to run this using Robot Framework, So that I can integrate all other work with this.
有人可以指导我吗?
推荐答案
如果您要在Windows上执行测试,则需要执行以下操作:
If you are trying to execute your test on windows here's what you need to do:
- 使用以下内容创建批处理脚本.相应地更改脚本. pythonpath应该指向您的sikuli项目,该项目必须具有关键字定义.
- Create a batch script with the following content. Change the script accordingly. pythonpath should have point to your sikuli project, which must have the keyword definitions.
robottest.bat
robottest.bat
@echo off
set sikuli_jar=C:\Program Files\Sikuli X\sikuli-script.jar
set robotframework_jar=C:\YourProject\robotframework-2.8.1.jar
java -cp "robotframework-2.8.1.jar;%sikuli_jar%" ^
-Dpython.path="%robotframework_jar%\Lib";"%sikuli_jar%\Lib" ^
org.robotframework.RobotFramework ^
--pythonpath=your-project.sikuli ^
--outputdir=TestResults ^
--noncritical non-critical ^
--loglevel=TRACE ^
%*
-
执行以下命令以运行测试.
Execute the following command to run your tests.
robottest测试/.
robottest Tests/.
您的项目可以具有以下目录结构.
Your project can have following directory structure.
您的项目-> a. 测试(此目录将包含您的测试)
b. TestResults (此目录将包含您的测试结果)
YourProject -> a. Tests (This directory will contain your tests)
b. TestResults (This directory will contain your test results)
c. your-project.sikuli (其中将包含带有关键字定义的库)
c. your-project.sikuli (This will contain libraries with keyword definitions)
这篇关于如何在机器人框架内运行sikuli脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!