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

Archiving #121

Merged
merged 4 commits into from
Jan 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -54,7 +54,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -68,5 +68,5 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v3

33 changes: 18 additions & 15 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
fail-fast: false
matrix:
os: [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ]
java-version: [ 11 ]
java-version: [ 17 ]
browser: ['googlechromeheadless', 'firefoxheadless', 'edgeheadless']
include:
- os: ubuntu-latest
Expand Down Expand Up @@ -43,9 +43,9 @@ jobs:
runs-on: ${{ matrix.os }}
name: Test on ${{ matrix.os }} with Java ${{ matrix.java-version }} using browser ${{ matrix.browser }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v2.3.0
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: ${{ matrix.java-version }}
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
run: echo "${{ env.SHA }}"

- name: Archive acceptances test results
uses: actions/upload-artifact@v2.2.4
uses: actions/upload-artifact@v4
with:
name: at-results-${{ matrix.browser }}-${{ matrix.os }}-${{ matrix.java-version }}
path: target/robotframework-reports
Expand All @@ -91,7 +91,7 @@ jobs:
echo "::set-output name=JOB_STATUS::$(python -c "print('${{ job.status }}'.lower())")"
if: always() && job.status == 'failure'

- uses: octokit/request-action@7e93b91076fad3920c29d44eb2a6311d929db3dd
- uses: octokit/request-action@dad4362715b7fb2ddedf9772c8670824af564f0d #v2.4.0
name: Update status with Github Status API
id: update_status_pr
with:
Expand All @@ -112,17 +112,20 @@ jobs:
runs-on: ubuntu-latest
name: Release package
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v2.3.0
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 11
java-version: 17
- name: Release Maven package
uses: samuelmeuli/action-maven-publish@201a45a3f311b2ee888f252ba9f4194257545709
with:
gpg_private_key: ${{ secrets.gpg_private_key }}
gpg_passphrase: ${{ secrets.gpg_passphrase }}
nexus_username: ${{ secrets.nexus_username }}
nexus_password: ${{ secrets.nexus_password }}
maven_args: -DskipTests -B -ntp
run:
echo $GPG_PRIVATE_KEY > .m2/private-key.txt
gpg --import --batch .m2/private-key.txt
rm .m2/private-key.txt
mvn clean deploy --batch-mode --activate-profiles deploy --settings ${{ github.workspace }}/.m2/settings.xml -DskipTests -B -ntp
env:
GPG_PRIVATE_KEY: ${{ secrets.gpg_private_key }}
GPG_PASSPHRASE: ${{ secrets.gpg_passphrase }}
NEXUS_USERNAME: ${{ secrets.nexus_username }}
NEXUS_PASSWORD: ${{ secrets.nexus_password }}
32 changes: 32 additions & 0 deletions .m2/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!-- Maven settings for CI -->
<settings
xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"
>
<profiles>
<!-- GPG settings -->
<profile>
<id>gpg</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<gpg.executable>gpg</gpg.executable>
<!-- Load passphrase from env variable -->
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
</properties>
</profile>
</profiles>

<servers>
<!-- Sonatype OSSRH credentials -->
<server>
<id>ossrh</id>
<!-- Load credentials from env variables -->
<username>${env.NEXUS_USERNAME}</username>
<password>${env.NEXUS_PASSWORD}</password>
</server>
</servers>
</settings>
Binary file modified DEPENDENCIES.md
Binary file not shown.
21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
> [!WARNING]
> Repository is not currently maintained. Version released on 25th of January will probably be last one for this library as it has mostly lost it's meaning after Robot Framework dropped Jython support (due to dropping support for Python 2)
>
> If you're interested of starting to maintain this library please check [MarketSquare](https://marketsquare.github.io/) and create issue to there.
>
> Repository will be archived for time being to make this very clear.

# Java port of the Python based SeleniumLibrary for Robot Framework

## Introduction
Expand All @@ -18,18 +25,18 @@ your pom.xml:
<dependency>
<groupId>com.github.marketsquare</groupId>
<artifactId>robotframework-seleniumlibrary</artifactId>
<version>4.0.0.0</version>
<version>4.28.1.0</version>
<scope>test</scope>
</dependency>

If you cannot use the robotframework-maven-plugin you can use the
[jar-with-dependencies](https://repo1.maven.org/maven2/com/github/marketsquare/robotframework-seleniumlibrary/4.0.0.0/robotframework-seleniumlibrary-4.0.0.0-jar-with-dependencies.jar),
which contains all required libraries except ios/android ones (Appium and Selendroid). Running of tests with this can be done with command `java -jar robotframework-seleniumlibrary-4.0.0.0-jar-with-dependencies.jar <test location>`.
[jar-with-dependencies](https://repo1.maven.org/maven2/com/github/marketsquare/robotframework-seleniumlibrary/4.28.1.0/robotframework-seleniumlibrary-4.28.1.0-jar-with-dependencies.jar),
which contains all required libraries except ios/android ones (Appium). Running of tests with this can be done with command `java -jar robotframework-seleniumlibrary-4.28.1.0-jar-with-dependencies.jar <test location>`.

- More information about this library can be found in the
[Keyword Documentation](https://repo1.maven.org/maven2/com/github/marketsquare/robotframework-seleniumlibrary/4.0.0.0/robotframework-seleniumlibrary-4.0.0.0.html).
[Keyword Documentation](https://repo1.maven.org/maven2/com/github/marketsquare/robotframework-seleniumlibrary/4.28.1.0/robotframework-seleniumlibrary-4.28.1.0.html).
- For keyword completion in RIDE you can download this
[Library Specs](https://repo1.maven.org/maven2/com/github/marketsquare/robotframework-seleniumlibrary/4.0.0.0/robotframework-seleniumlibrary-4.0.0.0.xml)
[Library Specs](https://repo1.maven.org/maven2/com/github/marketsquare/robotframework-seleniumlibrary/4.28.1.0/robotframework-seleniumlibrary-4.28.1.0.xml)
and place it in your PYTHONPATH.

## Old versions
Expand Down Expand Up @@ -82,8 +89,8 @@ which contains all required libraries. Running of tests with this can be done wi

## Testing IOS/Android browsers with library

Pre-Selenium 4 fat-jar contains Appium and Selendroid that allow testing of IOS and Android browsers. Those are dropped in Selenium 4 -versions,
so dependencies needs to be handles self with either Maven/Gradle or manually. If there's need to have fat-jar with those, please create issue about that.
Pre-Selenium 4 fat-jar contained Appium and Selendroid that allowed testing of IOS and Android browsers. Those are dropped in Selenium 4 -versions,
so dependencies needs to be handles self with either Maven/Gradle or manually. Also 4.28.1.0 version of the library moved purely to Appium. If there's need to have fat-jar with those, please create issue about that.

## Differences

Expand Down
42 changes: 16 additions & 26 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.github.marketsquare</groupId>
<artifactId>robotframework-seleniumlibrary</artifactId>
<version>4.0.0.1-SNAPSHOT</version>
<version>4.28.1.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Robot Framework :: SeleniumLibrary</name>
Expand Down Expand Up @@ -72,11 +72,12 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
<aspectj.version>1.9.8.RC1</aspectj.version>
<java.version>11</java.version>
<aspectj.version>1.9.21.2</aspectj.version>
<java.compile.version>17</java.compile.version>
<java.runtime.version>11</java.runtime.version>
<robotframework.maven.plugin.version>2.1.0</robotframework.maven.plugin.version>
<robotframework.version>4.1</robotframework.version>
<selenium.version>4.0.0</selenium.version>
<robotframework.version>4.1.2</robotframework.version>
<selenium.version>4.28.1</selenium.version>
<keywords.class>SeleniumLibrary</keywords.class>
<browser>googlechromeheadless</browser>
<downloadWebDriver>False</downloadWebDriver>
Expand Down Expand Up @@ -108,22 +109,10 @@
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>io.selendroid</groupId>
<artifactId>selendroid-client</artifactId>
<version>0.17.0</version>
<exclusions>
<exclusion>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
</exclusion>
</exclusions>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.appium</groupId>
<artifactId>java-client</artifactId>
<version>7.6.0</version>
<version>9.4.0</version>
<exclusions>
<exclusion>
<groupId>org.seleniumhq.selenium</groupId>
Expand All @@ -139,12 +128,12 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-exec</artifactId>
<version>1.3</version>
<version>1.4.0</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>htmlunit-driver</artifactId>
<version>2.53.0</version>
<version>4.13.0</version>
<exclusions>
<exclusion>
<groupId>org.seleniumhq.selenium</groupId>
Expand All @@ -163,18 +152,19 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>2.28.2</version>
<version>5.15.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
<version>5.0.3</version>
<!-- Issue with newer versions: https://github.com/bonigarcia/webdrivermanager/issues/1408 -->
<version>5.7.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.12.0</version>
<version>3.17.0</version>
</dependency>
</dependencies>

Expand Down Expand Up @@ -341,9 +331,9 @@
</execution>
</executions>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<complianceLevel>${java.version}</complianceLevel>
<source>${java.compile.version}</source>
<target>${java.runtime.version}</target>
<complianceLevel>${java.compile.version}</complianceLevel>
<showWeaveInfo>true</showWeaveInfo>
</configuration>
<dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.github.markusbernhardt.seleniumlibrary.keywords;

import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.ios.IOSDriver;
import io.github.bonigarcia.wdm.WebDriverManager;
import io.github.bonigarcia.wdm.config.DriverManagerType;
import io.selendroid.client.SelendroidDriver;

import java.io.File;
import java.lang.reflect.Field;
Expand Down Expand Up @@ -61,6 +61,8 @@
import com.github.markusbernhardt.seleniumlibrary.utils.WebDriverCache;
import com.github.markusbernhardt.seleniumlibrary.utils.WebDriverCache.SessionIdAliasWebDriverTuple;

import static org.openqa.selenium.remote.Browser.HTMLUNIT;

@RobotKeywords
public class BrowserManagement extends RunOnFailureKeywordsAdapter {

Expand Down Expand Up @@ -639,14 +641,14 @@ protected WebDriver createLocalWebDriver(String browserName, Capabilities desire
return new SafariDriver(new SafariOptions().merge(desiredCapabilities));
case "android":
try {
return new SelendroidDriver(desiredCapabilities);
return new AndroidDriver(desiredCapabilities);
} catch (Exception e) {
throw new SeleniumLibraryFatalException(e);
}
case "ipad":
case "iphone":
try {
return new IOSDriver<>(new URL(""), desiredCapabilities);
return new IOSDriver(new URL(""), desiredCapabilities);
} catch (Exception e) {
throw new SeleniumLibraryFatalException("Creating " + browserName + " instance failed.", e);
}
Expand Down Expand Up @@ -716,7 +718,7 @@ protected Capabilities createCapabilities(String browserName, String desiredCapa
case "firefoxheadless":
desiredCapabilities = new FirefoxOptions();
parseBrowserOptionsFirefox(browserOptions, desiredCapabilities);
((FirefoxOptions)desiredCapabilities).setHeadless(true);
((FirefoxOptions)desiredCapabilities).addArguments("-headless");
break;
case "ie":
case "internetexplorer":
Expand All @@ -727,7 +729,7 @@ protected Capabilities createCapabilities(String browserName, String desiredCapa
break;
case "edgeheadless":
desiredCapabilities = new EdgeOptions();
((EdgeOptions)desiredCapabilities).setHeadless(true);
((EdgeOptions)desiredCapabilities).addArguments("--headless=chrome");
break;
case "gc":
case "chrome":
Expand All @@ -742,14 +744,14 @@ protected Capabilities createCapabilities(String browserName, String desiredCapa
desiredCapabilities = new ChromeOptions();
logging.debug("Parsing chrome options: "+browserOptions);
parseBrowserOptionsChrome(browserOptions, desiredCapabilities);
((ChromeOptions)desiredCapabilities).setHeadless(true);
((ChromeOptions)desiredCapabilities).addArguments("--headless=chrome");
break;
case "safari":
desiredCapabilities = new SafariOptions();
break;
case "htmlunit":
case "htmlunitwithjs":
desiredCapabilities = DesiredCapabilities.htmlUnit();
desiredCapabilities = new DesiredCapabilities(HTMLUNIT.browserName(), "", Platform.ANY);
((DesiredCapabilities) desiredCapabilities).setBrowserName("htmlunit");
break;
default:
Expand Down Expand Up @@ -858,7 +860,7 @@ protected void parseBrowserOptionsFirefox(String browserOptions, Capabilities de
logging.warn("Unknown browserOption: " + key + ":" + entry.getValue());
}
}
((FirefoxOptions) desiredCapabilities).setCapability(FirefoxDriver.PROFILE, firefoxProfile);
((FirefoxOptions) desiredCapabilities).setProfile(firefoxProfile);
} else {
logging.warn("Invalid browserOptions: " + browserOptions);
}
Expand Down
Loading
Loading