我想通過在Java中使用Selenium WebDriver實現新的Robot Framework關鍵字來擴展Selenium2Library python庫(1.8.0)。如何通過使用Java中的Selenium WebDriver創建新的RobotFramework關鍵字來擴展Selenium2Library
爲了做到這一點,我需要能夠檢索我的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
- 機器人框架3.0.2(作爲Maven插件依賴)
- Selenium服務器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>
的提取物有沒有人做過類似的東西?