Skip to content
This repository was archived by the owner on Feb 2, 2025. It is now read-only.

Commit bd7038d

Browse files
committed
Merge pull request #2 from MarkusBernhardt/master
Update
2 parents 6a35c0e + 69b6306 commit bd7038d

File tree

10 files changed

+129
-92
lines changed

10 files changed

+129
-92
lines changed

CHANGES.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
CHANGES
22
=======
33

4-
unreleased
4+
Unreleased
5+
----------
6+
* Updating xml-doclet to version 1.0.5
7+
* Updating selenium-server to version 2.48.2
8+
* Updating aspectjrt to version 1.8.7
9+
* Updating selendroid-client to version 0.17.0
10+
* Updating java-client to version 3.2.0
11+
12+
1.4.0.7
513
----------
614
* Avoid NullPointerException in isEnabled method. See #53, #56. Great thanks to atcarmo for this patch.
715
* Updated selenium-server dependency to 2.43.1. See #58. Great thanks to WojtekKowaluk for this patch.

DEPENDENCIES.md

Lines changed: 70 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,93 @@
11
[INFO] ------------------------------------------------------------------------
2-
[INFO] Building Robot Framework :: Selenium2Library 1.2.0.14-SNAPSHOT
2+
[INFO] Building Robot Framework :: Selenium2Library 1.4.0.8-SNAPSHOT
33
[INFO] ------------------------------------------------------------------------
44
[INFO]
5-
[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ robotframework-selenium2library-java ---
6-
[INFO] com.github.markusbernhardt:robotframework-selenium2library-java:jar:1.2.0.14-SNAPSHOT
7-
[INFO] +- org.robotframework:javalib-core:jar:1.2:compile
5+
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ robotframework-selenium2library-java ---
6+
[INFO] com.github.markusbernhardt:robotframework-selenium2library-java:jar:1.4.0.8-SNAPSHOT
7+
[INFO] +- org.robotframework:javalib-core:jar:1.2.1:compile
88
[INFO] | +- commons-collections:commons-collections:jar:3.2:compile
99
[INFO] | \- com.thoughtworks.paranamer:paranamer:jar:1.1.2:compile
10-
[INFO] +- org.seleniumhq.selenium:selenium-server:jar:2.34.0:compile
10+
[INFO] +- com.github.markusbernhardt:xml-doclet:jar:1.0.5:compile
11+
[INFO] | +- com.sun:tools:jar:1.7:system
12+
[INFO] | +- commons-cli:commons-cli:jar:1.2:compile
13+
[INFO] | \- org.slf4j:slf4j-api:jar:1.7.12:compile
14+
[INFO] +- org.seleniumhq.selenium:selenium-server:jar:2.48.2:compile
15+
[INFO] | +- com.beust:jcommander:jar:1.48:compile
1116
[INFO] | +- org.bouncycastle:bcprov-jdk15on:jar:1.48:compile
1217
[INFO] | +- org.bouncycastle:bcpkix-jdk15on:jar:1.48:compile
1318
[INFO] | +- mx4j:mx4j-tools:jar:3.0.1:compile
1419
[INFO] | +- org.mortbay.jetty:servlet-api-2.5:jar:6.1.9:compile
15-
[INFO] | +- org.seleniumhq.selenium:jetty-repacked:jar:7.6.1:compile
20+
[INFO] | +- org.seleniumhq.selenium:jetty-repacked:jar:9.2.13.v20150730:compile
21+
[INFO] | +- javax.servlet:javax.servlet-api:jar:3.1.0:compile
22+
[INFO] | +- org.seleniumhq.selenium:jetty-rc-repacked:jar:5:compile
1623
[INFO] | +- net.jcip:jcip-annotations:jar:1.0:compile
17-
[INFO] | +- org.seleniumhq.selenium:selenium-java:jar:2.34.0:compile
18-
[INFO] | | +- org.seleniumhq.selenium:selenium-android-driver:jar:2.34.0:compile
19-
[INFO] | | +- org.seleniumhq.selenium:selenium-chrome-driver:jar:2.34.0:compile
20-
[INFO] | | +- org.seleniumhq.selenium:selenium-htmlunit-driver:jar:2.34.0:compile
21-
[INFO] | | | \- net.sourceforge.htmlunit:htmlunit:jar:2.12:compile
22-
[INFO] | | | +- xalan:xalan:jar:2.7.1:compile
23-
[INFO] | | | | \- xalan:serializer:jar:2.7.1:compile
24-
[INFO] | | | +- org.apache.commons:commons-lang3:jar:3.1:compile
25-
[INFO] | | | +- org.apache.httpcomponents:httpmime:jar:4.2.3:compile
26-
[INFO] | | | +- net.sourceforge.htmlunit:htmlunit-core-js:jar:2.12:compile
27-
[INFO] | | | +- xerces:xercesImpl:jar:2.10.0:compile
24+
[INFO] | +- org.seleniumhq.selenium:selenium-java:jar:2.48.2:compile
25+
[INFO] | | +- org.seleniumhq.selenium:selenium-chrome-driver:jar:2.48.2:compile
26+
[INFO] | | +- org.seleniumhq.selenium:selenium-edge-driver:jar:2.48.2:compile
27+
[INFO] | | | \- commons-io:commons-io:jar:2.4:compile
28+
[INFO] | | +- org.seleniumhq.selenium:selenium-htmlunit-driver:jar:2.48.2:compile
29+
[INFO] | | | \- net.sourceforge.htmlunit:htmlunit:jar:2.18:compile
30+
[INFO] | | | +- xalan:xalan:jar:2.7.2:compile
31+
[INFO] | | | | \- xalan:serializer:jar:2.7.2:compile
32+
[INFO] | | | +- org.apache.commons:commons-lang3:jar:3.4:compile
33+
[INFO] | | | +- org.apache.httpcomponents:httpmime:jar:4.5:compile
34+
[INFO] | | | +- net.sourceforge.htmlunit:htmlunit-core-js:jar:2.17:compile
35+
[INFO] | | | +- xerces:xercesImpl:jar:2.11.0:compile
2836
[INFO] | | | | \- xml-apis:xml-apis:jar:1.4.01:compile
29-
[INFO] | | | +- net.sourceforge.nekohtml:nekohtml:jar:1.9.18:compile
30-
[INFO] | | | +- net.sourceforge.cssparser:cssparser:jar:0.9.9:compile
37+
[INFO] | | | +- net.sourceforge.nekohtml:nekohtml:jar:1.9.22:compile
38+
[INFO] | | | +- net.sourceforge.cssparser:cssparser:jar:0.9.16:compile
3139
[INFO] | | | | \- org.w3c.css:sac:jar:1.3:compile
32-
[INFO] | | | \- org.eclipse.jetty:jetty-websocket:jar:8.1.9.v20130131:compile
33-
[INFO] | | | +- org.eclipse.jetty:jetty-util:jar:8.1.9.v20130131:compile
34-
[INFO] | | | +- org.eclipse.jetty:jetty-io:jar:8.1.9.v20130131:compile
35-
[INFO] | | | \- org.eclipse.jetty:jetty-http:jar:8.1.9.v20130131:compile
36-
[INFO] | | +- org.seleniumhq.selenium:selenium-firefox-driver:jar:2.34.0:compile
37-
[INFO] | | | \- commons-io:commons-io:jar:2.2:compile
38-
[INFO] | | +- org.seleniumhq.selenium:selenium-ie-driver:jar:2.34.0:compile
39-
[INFO] | | +- org.seleniumhq.selenium:selenium-iphone-driver:jar:2.34.0:compile
40-
[INFO] | | +- org.seleniumhq.selenium:selenium-safari-driver:jar:2.34.0:compile
41-
[INFO] | | +- org.seleniumhq.selenium:selenium-support:jar:2.34.0:compile
42-
[INFO] | | \- org.webbitserver:webbit:jar:0.4.14:compile
43-
[INFO] | | \- io.netty:netty:jar:3.5.2.Final:compile
40+
[INFO] | | | \- org.eclipse.jetty.websocket:websocket-client:jar:9.2.12.v20150709:compile
41+
[INFO] | | | +- org.eclipse.jetty:jetty-util:jar:9.2.12.v20150709:compile
42+
[INFO] | | | +- org.eclipse.jetty:jetty-io:jar:9.2.12.v20150709:compile
43+
[INFO] | | | \- org.eclipse.jetty.websocket:websocket-common:jar:9.2.12.v20150709:compile
44+
[INFO] | | | \- org.eclipse.jetty.websocket:websocket-api:jar:9.2.12.v20150709:compile
45+
[INFO] | | +- org.seleniumhq.selenium:selenium-firefox-driver:jar:2.48.2:compile
46+
[INFO] | | +- org.seleniumhq.selenium:selenium-ie-driver:jar:2.48.2:compile
47+
[INFO] | | +- org.seleniumhq.selenium:selenium-safari-driver:jar:2.48.2:compile
48+
[INFO] | | +- org.seleniumhq.selenium:selenium-support:jar:2.48.2:compile
49+
[INFO] | | +- org.webbitserver:webbit:jar:0.4.14:compile
50+
[INFO] | | | \- io.netty:netty:jar:3.5.2.Final:compile
51+
[INFO] | | \- org.seleniumhq.selenium:selenium-leg-rc:jar:2.48.2:compile
4452
[INFO] | +- org.yaml:snakeyaml:jar:1.8:compile
45-
[INFO] | \- commons-codec:commons-codec:jar:1.6:compile
53+
[INFO] | \- commons-codec:commons-codec:jar:1.10:compile
4654
[INFO] +- com.opera:operadriver:jar:1.5:compile
4755
[INFO] | +- com.opera:operalaunchers:jar:1.1:compile
4856
[INFO] | +- com.google.protobuf:protobuf-java:jar:2.4.1:compile
4957
[INFO] | +- com.google.guava:guava:jar:14.0:compile
5058
[INFO] | +- commons-jxpath:commons-jxpath:jar:1.3:compile
51-
[INFO] | +- org.apache.commons:commons-exec:jar:1.1:compile
5259
[INFO] | \- org.ini4j:ini4j:jar:0.5.2:compile
53-
[INFO] +- com.github.detro.ghostdriver:phantomjsdriver:jar:1.0.4:compile
54-
[INFO] | \- org.seleniumhq.selenium:selenium-remote-driver:jar:2.33.0:compile
55-
[INFO] | +- cglib:cglib-nodep:jar:2.1_3:compile
56-
[INFO] | +- org.json:json:jar:20080701:compile
57-
[INFO] | +- org.seleniumhq.selenium:selenium-api:jar:2.33.0:compile
58-
[INFO] | +- org.apache.httpcomponents:httpclient:jar:4.2.1:compile
59-
[INFO] | | +- org.apache.httpcomponents:httpcore:jar:4.2.1:compile
60-
[INFO] | | \- commons-logging:commons-logging:jar:1.1.1:compile
61-
[INFO] | +- net.java.dev.jna:jna:jar:3.4.0:compile
62-
[INFO] | \- net.java.dev.jna:platform:jar:3.4.0:compile
63-
[INFO] +- org.robotframework:robotframework:jar:2.8.1:compile
64-
[INFO] \- org.aspectj:aspectjrt:jar:1.7.3:compile
60+
[INFO] +- com.github.detro.ghostdriver:phantomjsdriver:jar:1.1.0:compile
61+
[INFO] +- org.robotframework:robotframework:jar:2.9.2:compile
62+
[INFO] +- org.aspectj:aspectjrt:jar:1.8.7:compile
63+
[INFO] +- com.googlecode.json-simple:json-simple:jar:1.1.1:compile
64+
[INFO] | \- junit:junit:jar:4.10:compile
65+
[INFO] | \- org.hamcrest:hamcrest-core:jar:1.1:compile
66+
[INFO] +- org.seleniumhq.selenium:selenium-remote-driver:jar:2.48.2:compile
67+
[INFO] | +- cglib:cglib-nodep:jar:2.1_3:compile
68+
[INFO] | +- com.google.code.gson:gson:jar:2.3.1:compile
69+
[INFO] | +- org.seleniumhq.selenium:selenium-api:jar:2.48.2:compile
70+
[INFO] | +- org.apache.httpcomponents:httpclient:jar:4.5.1:compile
71+
[INFO] | | +- org.apache.httpcomponents:httpcore:jar:4.4.3:compile
72+
[INFO] | | \- commons-logging:commons-logging:jar:1.2:compile
73+
[INFO] | +- net.java.dev.jna:jna:jar:4.1.0:compile
74+
[INFO] | \- net.java.dev.jna:jna-platform:jar:4.1.0:compile
75+
[INFO] +- io.selendroid:selendroid-client:jar:0.17.0:compile
76+
[INFO] | +- io.selendroid:selendroid-common:jar:0.17.0:compile
77+
[INFO] | | \- org.json:json:jar:20090211:compile
78+
[INFO] | \- io.selendroid:selendroid-server-common:jar:0.17.0:compile
79+
[INFO] | \- io.netty:netty-all:jar:4.0.21.Final:compile
80+
[INFO] +- io.appium:java-client:jar:3.2.0:compile
81+
[INFO] | +- cglib:cglib:jar:3.1:compile
82+
[INFO] | | \- org.ow2.asm:asm:jar:4.2:compile
83+
[INFO] | \- commons-validator:commons-validator:jar:1.4.1:compile
84+
[INFO] | +- commons-beanutils:commons-beanutils:jar:1.8.3:compile
85+
[INFO] | \- commons-digester:commons-digester:jar:1.8.1:compile
86+
[INFO] \- org.apache.commons:commons-exec:jar:1.3:compile
6587
[INFO] ------------------------------------------------------------------------
6688
[INFO] BUILD SUCCESS
6789
[INFO] ------------------------------------------------------------------------
68-
[INFO] Total time: 3.454s
69-
[INFO] Finished at: Sat Oct 12 11:58:25 CEST 2013
70-
[INFO] Final Memory: 14M/213M
90+
[INFO] Total time: 1.000 s
91+
[INFO] Finished at: 2015-10-27T10:31:41+01:00
92+
[INFO] Final Memory: 19M/309M
7193
[INFO] ------------------------------------------------------------------------

pom.xml

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
23
<modelVersion>4.0.0</modelVersion>
34

45
<parent>
@@ -20,10 +21,11 @@
2021
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2122
<downloadSources>true</downloadSources>
2223
<downloadJavadocs>true</downloadJavadocs>
23-
<aspectj.version>1.7.3</aspectj.version>
24+
<aspectj.version>1.8.7</aspectj.version>
2425
<java.version>1.6</java.version>
25-
<xml.doclet.version>1.0.4</xml.doclet.version>
26-
<robotframework.version>2.8.3</robotframework.version>
26+
<xml.doclet.version>1.0.5</xml.doclet.version>
27+
<robotframework.version>2.9.2</robotframework.version>
28+
<selenium.version>2.48.2</selenium.version>
2729
<keywords.class>Selenium2Library</keywords.class>
2830
</properties>
2931

@@ -52,7 +54,7 @@
5254
<dependency>
5355
<groupId>org.robotframework</groupId>
5456
<artifactId>javalib-core</artifactId>
55-
<version>1.2</version>
57+
<version>1.2.1</version>
5658
</dependency>
5759
<dependency>
5860
<groupId>com.github.markusbernhardt</groupId>
@@ -62,7 +64,7 @@
6264
<dependency>
6365
<groupId>org.seleniumhq.selenium</groupId>
6466
<artifactId>selenium-server</artifactId>
65-
<version>2.43.1</version>
67+
<version>${selenium.version}</version>
6668
</dependency>
6769
<dependency>
6870
<groupId>com.opera</groupId>
@@ -92,17 +94,22 @@
9294
<dependency>
9395
<groupId>org.seleniumhq.selenium</groupId>
9496
<artifactId>selenium-remote-driver</artifactId>
95-
<version>2.43.1</version>
97+
<version>${selenium.version}</version>
9698
</dependency>
9799
<dependency>
98100
<groupId>io.selendroid</groupId>
99101
<artifactId>selendroid-client</artifactId>
100-
<version>0.11.0</version>
102+
<version>0.17.0</version>
101103
</dependency>
102104
<dependency>
103105
<groupId>io.appium</groupId>
104106
<artifactId>java-client</artifactId>
105-
<version>2.0.0</version>
107+
<version>3.2.0</version>
108+
</dependency>
109+
<dependency>
110+
<groupId>org.apache.commons</groupId>
111+
<artifactId>commons-exec</artifactId>
112+
<version>1.3</version>
106113
</dependency>
107114
</dependencies>
108115

@@ -157,7 +164,7 @@
157164
<!-- Integration-Test, build documentation -->
158165
<groupId>org.robotframework</groupId>
159166
<artifactId>robotframework-maven-plugin</artifactId>
160-
<version>1.2</version>
167+
<version>1.4.5</version>
161168
<executions>
162169
<execution>
163170
<id>test</id>
@@ -211,7 +218,7 @@
211218
<!-- Set 1.7 as target, use project source encoding -->
212219
<groupId>org.apache.maven.plugins</groupId>
213220
<artifactId>maven-compiler-plugin</artifactId>
214-
<version>2.5.1</version>
221+
<version>3.3</version>
215222
<configuration>
216223
<source>${java.version}</source>
217224
<target>${java.version}</target>
@@ -225,7 +232,7 @@
225232
<!-- Build the fat jar with all dependencies -->
226233
<groupId>org.apache.maven.plugins</groupId>
227234
<artifactId>maven-assembly-plugin</artifactId>
228-
<version>2.4</version>
235+
<version>2.6</version>
229236
<configuration>
230237
<descriptorRefs>
231238
<descriptorRef>jar-with-dependencies</descriptorRef>
@@ -245,7 +252,7 @@
245252
<!-- extract documentation for libdoc -->
246253
<groupId>org.apache.maven.plugins</groupId>
247254
<artifactId>maven-javadoc-plugin</artifactId>
248-
<version>2.9.1</version>
255+
<version>2.10.3</version>
249256
<executions>
250257
<execution>
251258
<id>xml-doclet</id>
@@ -327,7 +334,7 @@
327334
<plugin>
328335
<groupId>org.apache.maven.plugins</groupId>
329336
<artifactId>maven-javadoc-plugin</artifactId>
330-
<version>2.9.1</version>
337+
<version>2.10.3</version>
331338
<executions>
332339
<execution>
333340
<id>attach-javadocs</id>
@@ -346,7 +353,7 @@
346353
<plugin>
347354
<groupId>org.codehaus.mojo</groupId>
348355
<artifactId>build-helper-maven-plugin</artifactId>
349-
<version>1.8</version>
356+
<version>1.9.1</version>
350357
<executions>
351358
<execution>
352359
<id>attach-artifacts</id>

src/main/java/com/github/markusbernhardt/selenium2library/Selenium2Library.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,13 +360,13 @@ public Selenium2Library(String timeout, String implicitWait) {
360360
* Default=Capture Page Screenshot. Optional custom keyword to
361361
* run on failure.
362362
*/
363-
public Selenium2Library(String timeout, String implicitWait, String runOnFailure) {
363+
public Selenium2Library(String timeout, String implicitWait, String keywordToRunOnFailure) {
364364
super();
365365
addKeywordPattern(KEYWORD_PATTERN);
366366
createKeywordFactory(); // => init annotations
367367
browserManagement.setSeleniumTimeout(timeout);
368368
browserManagement.setSeleniumImplicitWait(implicitWait);
369-
this.runOnFailure.registerKeywordToRunOnFailure(runOnFailure);
369+
runOnFailure.registerKeywordToRunOnFailure(keywordToRunOnFailure);
370370
}
371371

372372
// ##############################

src/main/java/com/github/markusbernhardt/selenium2library/keywords/BrowserManagement.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package com.github.markusbernhardt.selenium2library.keywords;
22

3+
import io.appium.java_client.ios.IOSDriver;
4+
import io.selendroid.client.SelendroidDriver;
5+
36
import java.io.File;
47
import java.io.IOException;
58
import java.lang.reflect.Field;
@@ -26,13 +29,11 @@
2629
import org.openqa.selenium.Dimension;
2730
import org.openqa.selenium.WebDriver;
2831
import org.openqa.selenium.WebElement;
29-
import io.selendroid.SelendroidDriver;
3032
import org.openqa.selenium.chrome.ChromeDriver;
3133
import org.openqa.selenium.firefox.FirefoxDriver;
3234
import org.openqa.selenium.firefox.FirefoxProfile;
3335
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
3436
import org.openqa.selenium.ie.InternetExplorerDriver;
35-
import io.appium.java_client.ios.IOSDriver;
3637
import org.openqa.selenium.phantomjs.PhantomJSDriver;
3738
import org.openqa.selenium.remote.Augmenter;
3839
import org.openqa.selenium.remote.DesiredCapabilities;
@@ -1384,7 +1385,7 @@ protected WebDriver createLocalWebDriver(String browserName, DesiredCapabilities
13841385
return driver;
13851386
} else if ("iphone".equals(browserName) || "ipad".equals(browserName)) {
13861387
try {
1387-
return new IOSDriver(new URL(""), desiredCapabilities);
1388+
return new IOSDriver<WebElement>(new URL(""), desiredCapabilities);
13881389
} catch (Exception e) {
13891390
throw new Selenium2LibraryFatalException("Creating " + browserName + " instance failed.", e);
13901391
}

src/main/java/com/github/markusbernhardt/selenium2library/keywords/Logging.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -365,12 +365,13 @@ protected void log0(String msg, String methodName, String methodArguments) {
365365
}
366366

367367
protected File getLogDir() {
368-
if (logDir == null) {
369-
PyString logDirName = (PyString) loggingPythonInterpreter.get().eval("GLOBAL_VARIABLES['${LOG FILE}']");
368+
369+
if (logDir == null && !loggingPythonInterpreter.get().eval("EXECUTION_CONTEXTS.current").toString().equals("None")) {
370+
PyString logDirName = (PyString) loggingPythonInterpreter.get().eval("BuiltIn().get_variables()['${LOG FILE}']");
370371
if (logDirName != null && !(logDirName.asString().toUpperCase().equals("NONE"))) {
371372
return new File(logDirName.asString()).getParentFile();
372373
}
373-
logDirName = (PyString) loggingPythonInterpreter.get().eval("GLOBAL_VARIABLES['${OUTPUTDIR}']");
374+
logDirName = (PyString) loggingPythonInterpreter.get().eval("BuiltIn().get_variables()['${OUTPUTDIR}']");
374375
return new File(logDirName.asString()).getParentFile();
375376
} else {
376377
return new File(logDir);
@@ -386,7 +387,7 @@ public static void setLogDir(String logDirectory) {
386387
@Override
387388
protected PythonInterpreter initialValue() {
388389
PythonInterpreter pythonInterpreter = new PythonInterpreter();
389-
pythonInterpreter.exec("from robot.variables import GLOBAL_VARIABLES; from robot.api import logger;");
390+
pythonInterpreter.exec("from robot.libraries.BuiltIn import BuiltIn; from robot.running.context import EXECUTION_CONTEXTS; from robot.api import logger;");
390391
return pythonInterpreter;
391392
}
392393
};

src/main/java/com/github/markusbernhardt/selenium2library/keywords/RunOnFailure.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public String registerKeywordToRunOnFailure(String keyword) {
9999
@Override
100100
protected PythonInterpreter initialValue() {
101101
PythonInterpreter pythonInterpreter = new PythonInterpreter();
102-
pythonInterpreter.exec("from robot.libraries import BuiltIn; BUILTIN = BuiltIn.BuiltIn();");
102+
pythonInterpreter.exec("from robot.libraries.BuiltIn import BuiltIn; from robot.running.context import EXECUTION_CONTEXTS; BIN = BuiltIn();");
103103
return pythonInterpreter;
104104
}
105105
};
@@ -111,10 +111,13 @@ public void runOnFailure() {
111111
if (runningOnFailureRoutine) {
112112
return;
113113
}
114-
runningOnFailureRoutine = true;
114+
if(runOnFailurePythonInterpreter.get().eval("EXECUTION_CONTEXTS.current").toString().equals("None")) {
115+
return;
116+
}
117+
115118
try {
116119
runOnFailurePythonInterpreter.get().exec(
117-
String.format("BUILTIN.run_keyword('%s')",
120+
String.format("BIN.run_keyword('%s')",
118121
runOnFailureKeyword.replace("'", "\\'").replace("\n", "\\n")));
119122
} catch (RuntimeException r) {
120123
logging.warn(String.format("Keyword '%s' could not be run on failure%s", runOnFailureKeyword,

src/main/java/com/github/markusbernhardt/selenium2library/locators/ElementFinder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ public static List<WebElement> find(WebDriver webDriver, String locator, String
261261
@Override
262262
protected PythonInterpreter initialValue() {
263263
PythonInterpreter pythonInterpreter = new PythonInterpreter();
264-
pythonInterpreter.exec("from robot.variables import GLOBAL_VARIABLES; from robot.api import logger;");
264+
pythonInterpreter.exec("from robot.libraries.BuiltIn import BuiltIn; from robot.api import logger;");
265265
return pythonInterpreter;
266266
}
267267
};

src/test/robotframework/objects/Google.Search.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Documentation Defines all required resources and keywords
44
Resource ../adapters/Selenium2Library.txt
55

66
*** Variables ***
7-
${Google.Search.Locator.SearchField} id=gbqfq
7+
${Google.Search.Locator.SearchField} id=lst-ib
88
${Google.Search.Locator.SearchResult.Rtomac} xpath=//a[contains(.,'MarkusBernhardt')]
99

1010
*** Keywords ***

0 commit comments

Comments
 (0)