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

Update #2

Merged
merged 15 commits into from
Oct 27, 2015
Merged
10 changes: 9 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
CHANGES
=======

unreleased
Unreleased
----------
* Updating xml-doclet to version 1.0.5
* Updating selenium-server to version 2.48.2
* Updating aspectjrt to version 1.8.7
* Updating selendroid-client to version 0.17.0
* Updating java-client to version 3.2.0

1.4.0.7
----------
* Avoid NullPointerException in isEnabled method. See #53, #56. Great thanks to atcarmo for this patch.
* Updated selenium-server dependency to 2.43.1. See #58. Great thanks to WojtekKowaluk for this patch.
Expand Down
118 changes: 70 additions & 48 deletions DEPENDENCIES.md
Original file line number Diff line number Diff line change
@@ -1,71 +1,93 @@
[INFO] ------------------------------------------------------------------------
[INFO] Building Robot Framework :: Selenium2Library 1.2.0.14-SNAPSHOT
[INFO] Building Robot Framework :: Selenium2Library 1.4.0.8-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ robotframework-selenium2library-java ---
[INFO] com.github.markusbernhardt:robotframework-selenium2library-java:jar:1.2.0.14-SNAPSHOT
[INFO] +- org.robotframework:javalib-core:jar:1.2:compile
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ robotframework-selenium2library-java ---
[INFO] com.github.markusbernhardt:robotframework-selenium2library-java:jar:1.4.0.8-SNAPSHOT
[INFO] +- org.robotframework:javalib-core:jar:1.2.1:compile
[INFO] | +- commons-collections:commons-collections:jar:3.2:compile
[INFO] | \- com.thoughtworks.paranamer:paranamer:jar:1.1.2:compile
[INFO] +- org.seleniumhq.selenium:selenium-server:jar:2.34.0:compile
[INFO] +- com.github.markusbernhardt:xml-doclet:jar:1.0.5:compile
[INFO] | +- com.sun:tools:jar:1.7:system
[INFO] | +- commons-cli:commons-cli:jar:1.2:compile
[INFO] | \- org.slf4j:slf4j-api:jar:1.7.12:compile
[INFO] +- org.seleniumhq.selenium:selenium-server:jar:2.48.2:compile
[INFO] | +- com.beust:jcommander:jar:1.48:compile
[INFO] | +- org.bouncycastle:bcprov-jdk15on:jar:1.48:compile
[INFO] | +- org.bouncycastle:bcpkix-jdk15on:jar:1.48:compile
[INFO] | +- mx4j:mx4j-tools:jar:3.0.1:compile
[INFO] | +- org.mortbay.jetty:servlet-api-2.5:jar:6.1.9:compile
[INFO] | +- org.seleniumhq.selenium:jetty-repacked:jar:7.6.1:compile
[INFO] | +- org.seleniumhq.selenium:jetty-repacked:jar:9.2.13.v20150730:compile
[INFO] | +- javax.servlet:javax.servlet-api:jar:3.1.0:compile
[INFO] | +- org.seleniumhq.selenium:jetty-rc-repacked:jar:5:compile
[INFO] | +- net.jcip:jcip-annotations:jar:1.0:compile
[INFO] | +- org.seleniumhq.selenium:selenium-java:jar:2.34.0:compile
[INFO] | | +- org.seleniumhq.selenium:selenium-android-driver:jar:2.34.0:compile
[INFO] | | +- org.seleniumhq.selenium:selenium-chrome-driver:jar:2.34.0:compile
[INFO] | | +- org.seleniumhq.selenium:selenium-htmlunit-driver:jar:2.34.0:compile
[INFO] | | | \- net.sourceforge.htmlunit:htmlunit:jar:2.12:compile
[INFO] | | | +- xalan:xalan:jar:2.7.1:compile
[INFO] | | | | \- xalan:serializer:jar:2.7.1:compile
[INFO] | | | +- org.apache.commons:commons-lang3:jar:3.1:compile
[INFO] | | | +- org.apache.httpcomponents:httpmime:jar:4.2.3:compile
[INFO] | | | +- net.sourceforge.htmlunit:htmlunit-core-js:jar:2.12:compile
[INFO] | | | +- xerces:xercesImpl:jar:2.10.0:compile
[INFO] | +- org.seleniumhq.selenium:selenium-java:jar:2.48.2:compile
[INFO] | | +- org.seleniumhq.selenium:selenium-chrome-driver:jar:2.48.2:compile
[INFO] | | +- org.seleniumhq.selenium:selenium-edge-driver:jar:2.48.2:compile
[INFO] | | | \- commons-io:commons-io:jar:2.4:compile
[INFO] | | +- org.seleniumhq.selenium:selenium-htmlunit-driver:jar:2.48.2:compile
[INFO] | | | \- net.sourceforge.htmlunit:htmlunit:jar:2.18:compile
[INFO] | | | +- xalan:xalan:jar:2.7.2:compile
[INFO] | | | | \- xalan:serializer:jar:2.7.2:compile
[INFO] | | | +- org.apache.commons:commons-lang3:jar:3.4:compile
[INFO] | | | +- org.apache.httpcomponents:httpmime:jar:4.5:compile
[INFO] | | | +- net.sourceforge.htmlunit:htmlunit-core-js:jar:2.17:compile
[INFO] | | | +- xerces:xercesImpl:jar:2.11.0:compile
[INFO] | | | | \- xml-apis:xml-apis:jar:1.4.01:compile
[INFO] | | | +- net.sourceforge.nekohtml:nekohtml:jar:1.9.18:compile
[INFO] | | | +- net.sourceforge.cssparser:cssparser:jar:0.9.9:compile
[INFO] | | | +- net.sourceforge.nekohtml:nekohtml:jar:1.9.22:compile
[INFO] | | | +- net.sourceforge.cssparser:cssparser:jar:0.9.16:compile
[INFO] | | | | \- org.w3c.css:sac:jar:1.3:compile
[INFO] | | | \- org.eclipse.jetty:jetty-websocket:jar:8.1.9.v20130131:compile
[INFO] | | | +- org.eclipse.jetty:jetty-util:jar:8.1.9.v20130131:compile
[INFO] | | | +- org.eclipse.jetty:jetty-io:jar:8.1.9.v20130131:compile
[INFO] | | | \- org.eclipse.jetty:jetty-http:jar:8.1.9.v20130131:compile
[INFO] | | +- org.seleniumhq.selenium:selenium-firefox-driver:jar:2.34.0:compile
[INFO] | | | \- commons-io:commons-io:jar:2.2:compile
[INFO] | | +- org.seleniumhq.selenium:selenium-ie-driver:jar:2.34.0:compile
[INFO] | | +- org.seleniumhq.selenium:selenium-iphone-driver:jar:2.34.0:compile
[INFO] | | +- org.seleniumhq.selenium:selenium-safari-driver:jar:2.34.0:compile
[INFO] | | +- org.seleniumhq.selenium:selenium-support:jar:2.34.0:compile
[INFO] | | \- org.webbitserver:webbit:jar:0.4.14:compile
[INFO] | | \- io.netty:netty:jar:3.5.2.Final:compile
[INFO] | | | \- org.eclipse.jetty.websocket:websocket-client:jar:9.2.12.v20150709:compile
[INFO] | | | +- org.eclipse.jetty:jetty-util:jar:9.2.12.v20150709:compile
[INFO] | | | +- org.eclipse.jetty:jetty-io:jar:9.2.12.v20150709:compile
[INFO] | | | \- org.eclipse.jetty.websocket:websocket-common:jar:9.2.12.v20150709:compile
[INFO] | | | \- org.eclipse.jetty.websocket:websocket-api:jar:9.2.12.v20150709:compile
[INFO] | | +- org.seleniumhq.selenium:selenium-firefox-driver:jar:2.48.2:compile
[INFO] | | +- org.seleniumhq.selenium:selenium-ie-driver:jar:2.48.2:compile
[INFO] | | +- org.seleniumhq.selenium:selenium-safari-driver:jar:2.48.2:compile
[INFO] | | +- org.seleniumhq.selenium:selenium-support:jar:2.48.2:compile
[INFO] | | +- org.webbitserver:webbit:jar:0.4.14:compile
[INFO] | | | \- io.netty:netty:jar:3.5.2.Final:compile
[INFO] | | \- org.seleniumhq.selenium:selenium-leg-rc:jar:2.48.2:compile
[INFO] | +- org.yaml:snakeyaml:jar:1.8:compile
[INFO] | \- commons-codec:commons-codec:jar:1.6:compile
[INFO] | \- commons-codec:commons-codec:jar:1.10:compile
[INFO] +- com.opera:operadriver:jar:1.5:compile
[INFO] | +- com.opera:operalaunchers:jar:1.1:compile
[INFO] | +- com.google.protobuf:protobuf-java:jar:2.4.1:compile
[INFO] | +- com.google.guava:guava:jar:14.0:compile
[INFO] | +- commons-jxpath:commons-jxpath:jar:1.3:compile
[INFO] | +- org.apache.commons:commons-exec:jar:1.1:compile
[INFO] | \- org.ini4j:ini4j:jar:0.5.2:compile
[INFO] +- com.github.detro.ghostdriver:phantomjsdriver:jar:1.0.4:compile
[INFO] | \- org.seleniumhq.selenium:selenium-remote-driver:jar:2.33.0:compile
[INFO] | +- cglib:cglib-nodep:jar:2.1_3:compile
[INFO] | +- org.json:json:jar:20080701:compile
[INFO] | +- org.seleniumhq.selenium:selenium-api:jar:2.33.0:compile
[INFO] | +- org.apache.httpcomponents:httpclient:jar:4.2.1:compile
[INFO] | | +- org.apache.httpcomponents:httpcore:jar:4.2.1:compile
[INFO] | | \- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] | +- net.java.dev.jna:jna:jar:3.4.0:compile
[INFO] | \- net.java.dev.jna:platform:jar:3.4.0:compile
[INFO] +- org.robotframework:robotframework:jar:2.8.1:compile
[INFO] \- org.aspectj:aspectjrt:jar:1.7.3:compile
[INFO] +- com.github.detro.ghostdriver:phantomjsdriver:jar:1.1.0:compile
[INFO] +- org.robotframework:robotframework:jar:2.9.2:compile
[INFO] +- org.aspectj:aspectjrt:jar:1.8.7:compile
[INFO] +- com.googlecode.json-simple:json-simple:jar:1.1.1:compile
[INFO] | \- junit:junit:jar:4.10:compile
[INFO] | \- org.hamcrest:hamcrest-core:jar:1.1:compile
[INFO] +- org.seleniumhq.selenium:selenium-remote-driver:jar:2.48.2:compile
[INFO] | +- cglib:cglib-nodep:jar:2.1_3:compile
[INFO] | +- com.google.code.gson:gson:jar:2.3.1:compile
[INFO] | +- org.seleniumhq.selenium:selenium-api:jar:2.48.2:compile
[INFO] | +- org.apache.httpcomponents:httpclient:jar:4.5.1:compile
[INFO] | | +- org.apache.httpcomponents:httpcore:jar:4.4.3:compile
[INFO] | | \- commons-logging:commons-logging:jar:1.2:compile
[INFO] | +- net.java.dev.jna:jna:jar:4.1.0:compile
[INFO] | \- net.java.dev.jna:jna-platform:jar:4.1.0:compile
[INFO] +- io.selendroid:selendroid-client:jar:0.17.0:compile
[INFO] | +- io.selendroid:selendroid-common:jar:0.17.0:compile
[INFO] | | \- org.json:json:jar:20090211:compile
[INFO] | \- io.selendroid:selendroid-server-common:jar:0.17.0:compile
[INFO] | \- io.netty:netty-all:jar:4.0.21.Final:compile
[INFO] +- io.appium:java-client:jar:3.2.0:compile
[INFO] | +- cglib:cglib:jar:3.1:compile
[INFO] | | \- org.ow2.asm:asm:jar:4.2:compile
[INFO] | \- commons-validator:commons-validator:jar:1.4.1:compile
[INFO] | +- commons-beanutils:commons-beanutils:jar:1.8.3:compile
[INFO] | \- commons-digester:commons-digester:jar:1.8.1:compile
[INFO] \- org.apache.commons:commons-exec:jar:1.3:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.454s
[INFO] Finished at: Sat Oct 12 11:58:25 CEST 2013
[INFO] Final Memory: 14M/213M
[INFO] Total time: 1.000 s
[INFO] Finished at: 2015-10-27T10:31:41+01:00
[INFO] Final Memory: 19M/309M
[INFO] ------------------------------------------------------------------------
37 changes: 22 additions & 15 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<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">
<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">
<modelVersion>4.0.0</modelVersion>

<parent>
Expand All @@ -20,10 +21,11 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
<aspectj.version>1.7.3</aspectj.version>
<aspectj.version>1.8.7</aspectj.version>
<java.version>1.6</java.version>
<xml.doclet.version>1.0.4</xml.doclet.version>
<robotframework.version>2.8.3</robotframework.version>
<xml.doclet.version>1.0.5</xml.doclet.version>
<robotframework.version>2.9.2</robotframework.version>
<selenium.version>2.48.2</selenium.version>
<keywords.class>Selenium2Library</keywords.class>
</properties>

Expand Down Expand Up @@ -52,7 +54,7 @@
<dependency>
<groupId>org.robotframework</groupId>
<artifactId>javalib-core</artifactId>
<version>1.2</version>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>com.github.markusbernhardt</groupId>
Expand All @@ -62,7 +64,7 @@
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>2.43.1</version>
<version>${selenium.version}</version>
</dependency>
<dependency>
<groupId>com.opera</groupId>
Expand Down Expand Up @@ -92,17 +94,22 @@
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-remote-driver</artifactId>
<version>2.43.1</version>
<version>${selenium.version}</version>
</dependency>
<dependency>
<groupId>io.selendroid</groupId>
<artifactId>selendroid-client</artifactId>
<version>0.11.0</version>
<version>0.17.0</version>
</dependency>
<dependency>
<groupId>io.appium</groupId>
<artifactId>java-client</artifactId>
<version>2.0.0</version>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-exec</artifactId>
<version>1.3</version>
</dependency>
</dependencies>

Expand Down Expand Up @@ -157,7 +164,7 @@
<!-- Integration-Test, build documentation -->
<groupId>org.robotframework</groupId>
<artifactId>robotframework-maven-plugin</artifactId>
<version>1.2</version>
<version>1.4.5</version>
<executions>
<execution>
<id>test</id>
Expand Down Expand Up @@ -211,7 +218,7 @@
<!-- Set 1.7 as target, use project source encoding -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<version>3.3</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
Expand All @@ -225,7 +232,7 @@
<!-- Build the fat jar with all dependencies -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<version>2.6</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
Expand All @@ -245,7 +252,7 @@
<!-- extract documentation for libdoc -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<version>2.10.3</version>
<executions>
<execution>
<id>xml-doclet</id>
Expand Down Expand Up @@ -327,7 +334,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<version>2.10.3</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand All @@ -346,7 +353,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.8</version>
<version>1.9.1</version>
<executions>
<execution>
<id>attach-artifacts</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,13 +360,13 @@ public Selenium2Library(String timeout, String implicitWait) {
* Default=Capture Page Screenshot. Optional custom keyword to
* run on failure.
*/
public Selenium2Library(String timeout, String implicitWait, String runOnFailure) {
public Selenium2Library(String timeout, String implicitWait, String keywordToRunOnFailure) {
super();
addKeywordPattern(KEYWORD_PATTERN);
createKeywordFactory(); // => init annotations
browserManagement.setSeleniumTimeout(timeout);
browserManagement.setSeleniumImplicitWait(implicitWait);
this.runOnFailure.registerKeywordToRunOnFailure(runOnFailure);
runOnFailure.registerKeywordToRunOnFailure(keywordToRunOnFailure);
}

// ##############################
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.github.markusbernhardt.selenium2library.keywords;

import io.appium.java_client.ios.IOSDriver;
import io.selendroid.client.SelendroidDriver;

import java.io.File;
import java.io.IOException;
import java.lang.reflect.Field;
Expand All @@ -26,13 +29,11 @@
import org.openqa.selenium.Dimension;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import io.selendroid.SelendroidDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
import io.appium.java_client.ios.IOSDriver;
import org.openqa.selenium.phantomjs.PhantomJSDriver;
import org.openqa.selenium.remote.Augmenter;
import org.openqa.selenium.remote.DesiredCapabilities;
Expand Down Expand Up @@ -1384,7 +1385,7 @@ protected WebDriver createLocalWebDriver(String browserName, DesiredCapabilities
return driver;
} else if ("iphone".equals(browserName) || "ipad".equals(browserName)) {
try {
return new IOSDriver(new URL(""), desiredCapabilities);
return new IOSDriver<WebElement>(new URL(""), desiredCapabilities);
} catch (Exception e) {
throw new Selenium2LibraryFatalException("Creating " + browserName + " instance failed.", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,12 +365,13 @@ protected void log0(String msg, String methodName, String methodArguments) {
}

protected File getLogDir() {
if (logDir == null) {
PyString logDirName = (PyString) loggingPythonInterpreter.get().eval("GLOBAL_VARIABLES['${LOG FILE}']");

if (logDir == null && !loggingPythonInterpreter.get().eval("EXECUTION_CONTEXTS.current").toString().equals("None")) {
PyString logDirName = (PyString) loggingPythonInterpreter.get().eval("BuiltIn().get_variables()['${LOG FILE}']");
if (logDirName != null && !(logDirName.asString().toUpperCase().equals("NONE"))) {
return new File(logDirName.asString()).getParentFile();
}
logDirName = (PyString) loggingPythonInterpreter.get().eval("GLOBAL_VARIABLES['${OUTPUTDIR}']");
logDirName = (PyString) loggingPythonInterpreter.get().eval("BuiltIn().get_variables()['${OUTPUTDIR}']");
return new File(logDirName.asString()).getParentFile();
} else {
return new File(logDir);
Expand All @@ -386,7 +387,7 @@ public static void setLogDir(String logDirectory) {
@Override
protected PythonInterpreter initialValue() {
PythonInterpreter pythonInterpreter = new PythonInterpreter();
pythonInterpreter.exec("from robot.variables import GLOBAL_VARIABLES; from robot.api import logger;");
pythonInterpreter.exec("from robot.libraries.BuiltIn import BuiltIn; from robot.running.context import EXECUTION_CONTEXTS; from robot.api import logger;");
return pythonInterpreter;
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public String registerKeywordToRunOnFailure(String keyword) {
@Override
protected PythonInterpreter initialValue() {
PythonInterpreter pythonInterpreter = new PythonInterpreter();
pythonInterpreter.exec("from robot.libraries import BuiltIn; BUILTIN = BuiltIn.BuiltIn();");
pythonInterpreter.exec("from robot.libraries.BuiltIn import BuiltIn; from robot.running.context import EXECUTION_CONTEXTS; BIN = BuiltIn();");
return pythonInterpreter;
}
};
Expand All @@ -111,10 +111,13 @@ public void runOnFailure() {
if (runningOnFailureRoutine) {
return;
}
runningOnFailureRoutine = true;
if(runOnFailurePythonInterpreter.get().eval("EXECUTION_CONTEXTS.current").toString().equals("None")) {
return;
}

try {
runOnFailurePythonInterpreter.get().exec(
String.format("BUILTIN.run_keyword('%s')",
String.format("BIN.run_keyword('%s')",
runOnFailureKeyword.replace("'", "\\'").replace("\n", "\\n")));
} catch (RuntimeException r) {
logging.warn(String.format("Keyword '%s' could not be run on failure%s", runOnFailureKeyword,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ public static List<WebElement> find(WebDriver webDriver, String locator, String
@Override
protected PythonInterpreter initialValue() {
PythonInterpreter pythonInterpreter = new PythonInterpreter();
pythonInterpreter.exec("from robot.variables import GLOBAL_VARIABLES; from robot.api import logger;");
pythonInterpreter.exec("from robot.libraries.BuiltIn import BuiltIn; from robot.api import logger;");
return pythonInterpreter;
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/test/robotframework/objects/Google.Search.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Documentation Defines all required resources and keywords
Resource ../adapters/Selenium2Library.txt

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

*** Keywords ***
Expand Down
Loading