简体   繁体   English

如何将Sikuli测试作为独立可执行文件运行

[英]How to run a Sikuli test as a standalone executable

I wrote some Sikuli code in my system using Sikuli IDE. 我使用Sikuli IDE在系统中编写了一些Sikuli代码。 How do I convert this .sikuli file and SikuliX setup to *.exe or *.jar and run in another system? 如何将这个.sikuli文件和SikuliX安装程序转换为*.exe*.jar并在另一个系统中运行?

Just example code in Sikuli IDE: 只是Sikuli IDE中的示例代码:

type(Key.WIN)
type("Internet Explorer"+Key.ENTER)
click(Pattern("1517398787539.png").targetOffset(-41,1))
exit()
type('A', Key.CTRL)
type(Key.DELETE)
type("www.google.com"+Key.ENTER)
exit()

Theoretically you can do both but not directly from IDE. 从理论上讲,您可以同时执行两个操作,但不能直接从IDE中执行。 If you're more comfortable with Python, move your script to a standalone .py file and make it do what you want. 如果您更熟悉Python,请将脚本移到独立的.py文件中,然后执行所需的操作。 Then you can use py2exe to convert it into a standalone executable script. 然后,您可以使用py2exe将其转换为独立的可执行脚本。

If you want jar then I think you have no other choice than rewriting your script in Java and then pack it into a jar with all the relevant dependencies. 如果您想要jar,那么我认为您别无选择,只能用Java重写脚本,然后将其打包到具有所有相关依赖项的jar中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM