<commit_before>Java port of the Selenium 2 (WebDriver) Python library for Robot Framework
==========================================================================

Introduction
------------

This Java port of the existing Selenium2Library was created to enable
the usage of a Selenium 2 library with Jython.
* Python Selenium2Library needs Python 2.6 upwards
* The latests stable release of Jython is 2.5.3
* Jython 2.7a2 is a alpha version and missing essential features
* There seems to be no further development of a stable Jython 2.7

Usage
-----

This library is a direct replacement to the Python Selenium2Library.
There are almost no changes necesssary to the existing code. You 
can execute the same testcases and keywords with Python and Jython.

If you are using the robotframework-maven-plugin you can
use this library by adding the following dependency to 
your pom.xml:

    <dependency>
        <groupId>com.github.markusbernhardt</groupId>
        <artifactId>robotframework-selenium2library-java</artifactId>
        <version>1.1.0.5</version>
        <scope>test</scope>
    </dependency>

Differences
-----------

* Robotframework does not support providing arguments to Java libraries

  With Python it is possible to provide arguments to libraries
  
        *** Settings ***
        Library    Selenium2Library    15    30    run_on_failure=Log Source
  
  This is not possible with a Java Library. But it can be done in a way
  that works with Java and Python
  
        *** Settings ***
        Library    Selenium2Library
        
        *** Keywords ***
        Open
            Open Browser    <url>    <browser>
            Set Selenium Timeout    15
            Set Selenium Implicit Wait    30
            Register Keyword To Run On Failure    Log Source

* Robotframework does not support named arguments with Java libraries

  It is not possible to use named arguments. See User Guide 2.2.2
  
* Selenium Speed not implemented

  Setting the Selenium Speed is deprecated several years and not
  implemented in WebDriver. The Python Selenium2Library tries to
  emulate the old behavior. I have not implemented this emulation
  for the following reasons.
  
  * As far as I understand the emulation is broken and only works
    with RemoteWebDriver
  * I do not know how to implement that in a correct way with Java 
  * There is a reason, why this is not implemented in WebDriver.
    It's a bad idea.

Enhancements
------------

<dl>
  <dt>Custom JavaScript Locators</dt>
<dd>We added the keyword Add Location Strategy. This keyword is somewhat
analogous to the SeleniumLibrary (RC) keyword. It can be used to register
a JavaScript function as locator with the specified strategy name. The 
registered function has to return a WebElement, a List of WebElements or
null. This feature was requested in issue #1.
<table>
  <tr><th>Keyword</th><th>Arguments</th></tr>
  <tr><td>Add Location Strategy</td><td>strategy_name, function_definition</td></tr>
</table>

A small example:

        Selenium2Library.Add Location Strategy    elementById    return window.document.getElementById(arguments[0]);
        Input Text    elementById=firstName    Max

</dd>
  
  <dt>Proxy Handling</dt>
<dd>We added proper proxy handling for RemoteWebDriver instances. This is
needed, if you want to connect to an external Selenium grid through a
local HTTP proxy. Our implementation handles BASIC, DIGEST and NTLM
based authentication schemes correctly. We added the following keyword.
<table>
  <tr><th>Keyword</th><th>Arguments</th></tr>
  <tr><td>Set Remote Web Driver Proxy</td><td>host,port,user=NONE,password=NONE,domain=NONE,workstation=NONE</td></tr>
</table>
Some additional info:
<ul><commit_msg>Issue #1 - Fix readme<commit_after>Java port of the Selenium 2 (WebDriver) Python library for Robot Framework
==========================================================================

Introduction
------------

This Java port of the existing Selenium2Library was created to enable
the usage of a Selenium 2 library with Jython.
* Python Selenium2Library needs Python 2.6 upwards
* The latests stable release of Jython is 2.5.3
* Jython 2.7a2 is a alpha version and missing essential features
* There seems to be no further development of a stable Jython 2.7

Usage
-----

This library is a direct replacement to the Python Selenium2Library.
There are almost no changes necesssary to the existing code. You 
can execute the same testcases and keywords with Python and Jython.

If you are using the robotframework-maven-plugin you can
use this library by adding the following dependency to 
your pom.xml:

    <dependency>
        <groupId>com.github.markusbernhardt</groupId>
        <artifactId>robotframework-selenium2library-java</artifactId>
        <version>1.1.0.5</version>
        <scope>test</scope>
    </dependency>

Differences
-----------

* Robotframework does not support providing arguments to Java libraries

  With Python it is possible to provide arguments to libraries
  
        *** Settings ***
        Library    Selenium2Library    15    30    run_on_failure=Log Source
  
  This is not possible with a Java Library. But it can be done in a way
  that works with Java and Python
  
        *** Settings ***
        Library    Selenium2Library
        
        *** Keywords ***
        Open
            Open Browser    <url>    <browser>
            Set Selenium Timeout    15
            Set Selenium Implicit Wait    30
            Register Keyword To Run On Failure    Log Source

* Robotframework does not support named arguments with Java libraries

  It is not possible to use named arguments. See User Guide 2.2.2
  
* Selenium Speed not implemented

  Setting the Selenium Speed is deprecated several years and not
  implemented in WebDriver. The Python Selenium2Library tries to
  emulate the old behavior. I have not implemented this emulation
  for the following reasons.
  
  * As far as I understand the emulation is broken and only works
    with RemoteWebDriver
  * I do not know how to implement that in a correct way with Java 
  * There is a reason, why this is not implemented in WebDriver.
    It's a bad idea.

Enhancements
------------

<dl>
  <dt>Custom JavaScript Locators</dt>
<dd>We added the keyword Add Location Strategy. This keyword is somewhat
analogous to the SeleniumLibrary (RC) keyword. It can be used to register
a JavaScript function as locator with the specified strategy name. The 
registered function has to return a WebElement, a List of WebElements or
null. This feature was requested in issue #1.
<table>
  <tr><th>Keyword</th><th>Arguments</th></tr>
  <tr><td>Add Location Strategy</td><td>strategy_name, function_definition</td></tr>
</table>

A small example:
<p>
<code>
        Selenium2Library.Add Location Strategy    elementById    return window.document.getElementById(arguments[0]);<br>
        Input Text    elementById=firstName    Max<br>
</code>

</dd>
  
  <dt>Proxy Handling</dt>
<dd>We added proper proxy handling for RemoteWebDriver instances. This is
needed, if you want to connect to an external Selenium grid through a
local HTTP proxy. Our implementation handles BASIC, DIGEST and NTLM
based authentication schemes correctly. We added the following keyword.
<table>
  <tr><th>Keyword</th><th>Arguments</th></tr>
  <tr><td>Set Remote Web Driver Proxy</td><td>host,port,user=NONE,password=NONE,domain=NONE,workstation=NONE</td></tr>
</table>
Some additional info:
<ul>
{'fraction_non_alphanumeric': 0.09138346267059139, 'fraction_numerical': 0.010034787262510034, 'mean_word_length': 3.4048320565704184, 'pattern_counts': {'":': 0, '<': 106, '<?xml version=': 0, '>': 106, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4679983', 'n_tokens_mistral': 2064, 'n_tokens_neox': 1957, 'n_words': 881}