How can we use Sikuli with Selenium in Python?

佐手、 提交于 2021-02-08 07:51:07

问题


I know that how we can use Sikuli in Java. But I have some code in Python which is automating a web application, and I want to use Sikuli in it. I searched a lot on the Internet about how we can use Sikuli in Python. But I did not find any good resource related to it.

How can I import Sikuli script in a Python project in Eclipse? When I added the sikuli-script.jar file in the Python path in Eclipse and when I am trying to use

import * from sikuli

Then I am getting "there is no such type of module named sikuli".


回答1:


Sikuli is a tool written in Java and hence you can't use it in your Python code as is. Instead you have the option to use it within a Jython environment, that provides you the Python syntax and enables running jar packages. If you are not using many third party Python libraries and mainly stick to the generic functionality, you shouldn't get into too much trouble transferring from pure Python to Jython.

There are clear instructions of how to use Sikuli with Jython on SikuliX official website. If you have any related questions, you can post the here.



来源:https://stackoverflow.com/questions/39302624/how-can-we-use-sikuli-with-selenium-in-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!