【发布时间】:2018-02-04 12:01:52
【问题描述】:
我正在尝试通过在 Java 中使用 Selenium WebDriver 实现新的机器人框架关键字来扩展 Selenium2Library python 库 (1.8.0)。
为此,我需要能够在我的 Java 关键字中检索 Selenium2Library python 库使用的 WebDriver 实例。
请注意,我不想使用 Markus Benhardt 创建的 Selenium 2 (WebDriver) Python 库的 Java 端口,因为它基于旧版本的 Selenium2Library,所以它显然已经过时了。
我听说使用 Jython 2.7,我们现在可以在 Java 上使用 Python 版本的 Selenium2Library...但我的问题是...如何?
我的设置正在使用:
- Robot Framework Maven Plugin 1.4.7
- Robot Framework 3.0.2(作为 maven 插件依赖项)
- Selenium Server 2.53.1(作为 maven 插件依赖项)
- Selenium2Library python 库 (1.8.0)
- Robot Framework Javalib Core 1.2.1
这是我的 pom.xml 的摘录
<plugin>
<groupId>org.robotframework</groupId>
<artifactId>robotframework-maven-plugin</artifactId>
<version>1.4.7</version>
<configuration>
<extraPathDirectories>
<extraPathDirectory>/usr/local/lib/python2.7/site-packages</extraPathDirectory>
</extraPathDirectories>
</configuration>
<executions>
<execution>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<dependencies>
<!-- Robot Framework - High level test automation framework -->
<dependency>
<groupId>org.robotframework</groupId>
<artifactId>robotframework</artifactId>
<version>3.0.2</version>
</dependency>
<!-- Selenium Server -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>2.53.1</version>
</dependency>
</dependencies>
</plugin>
有人做过这样的事吗?
【问题讨论】:
标签: java python-2.7 maven selenium-webdriver robotframework