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

Commit 6a35c0e

Browse files
committed
Revert "Libdoc working"
This reverts commit 68245eb.
1 parent 68245eb commit 6a35c0e

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<aspectj.version>1.7.3</aspectj.version>
2424
<java.version>1.6</java.version>
2525
<xml.doclet.version>1.0.4</xml.doclet.version>
26-
<robotframework.version>2.9.1</robotframework.version>
26+
<robotframework.version>2.8.3</robotframework.version>
2727
<keywords.class>Selenium2Library</keywords.class>
2828
</properties>
2929

@@ -157,7 +157,7 @@
157157
<!-- Integration-Test, build documentation -->
158158
<groupId>org.robotframework</groupId>
159159
<artifactId>robotframework-maven-plugin</artifactId>
160-
<version>1.4.4</version>
160+
<version>1.2</version>
161161
<executions>
162162
<execution>
163163
<id>test</id>

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

Lines changed: 2 additions & 3 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 keywordToRunOnFailure) {
363+
public Selenium2Library(String timeout, String implicitWait, String runOnFailure) {
364364
super();
365365
addKeywordPattern(KEYWORD_PATTERN);
366366
createKeywordFactory(); // => init annotations
367367
browserManagement.setSeleniumTimeout(timeout);
368368
browserManagement.setSeleniumImplicitWait(implicitWait);
369-
runOnFailure.registerKeywordToRunOnFailure(keywordToRunOnFailure);
369+
this.runOnFailure.registerKeywordToRunOnFailure(runOnFailure);
370370
}
371371

372372
// ##############################
@@ -510,7 +510,6 @@ public String getKeywordDocumentation(String keywordName) {
510510
}
511511

512512
public static Selenium2Library getLibraryInstance() throws ScriptException {
513-
System.out.println("Testi");
514513
ScriptEngine engine = new ScriptEngineManager().getEngineByName("python");
515514
engine.put("library", "Selenium2Library");
516515
engine.eval("from robot.libraries.BuiltIn import BuiltIn");

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

Lines changed: 3 additions & 6 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.BuiltIn import BuiltIn; from robot.running.context import EXECUTION_CONTEXTS; BIN = BuiltIn();");
102+
pythonInterpreter.exec("from robot.libraries import BuiltIn; BUILTIN = BuiltIn.BuiltIn();");
103103
return pythonInterpreter;
104104
}
105105
};
@@ -111,13 +111,10 @@ public void runOnFailure() {
111111
if (runningOnFailureRoutine) {
112112
return;
113113
}
114-
if(runOnFailurePythonInterpreter.get().eval("EXECUTION_CONTEXTS.current").toString().equals("None")) {
115-
return;
116-
}
117-
114+
runningOnFailureRoutine = true;
118115
try {
119116
runOnFailurePythonInterpreter.get().exec(
120-
String.format("BIN.run_keyword('%s')",
117+
String.format("BUILTIN.run_keyword('%s')",
121118
runOnFailureKeyword.replace("'", "\\'").replace("\n", "\\n")));
122119
} catch (RuntimeException r) {
123120
logging.warn(String.format("Keyword '%s' could not be run on failure%s", runOnFailureKeyword,

0 commit comments

Comments
 (0)