Skip to content

Commit 808c9f5

Browse files
committed
Merge branch 'master' into dependabot
2 parents 5703ea9 + a868f70 commit 808c9f5

34 files changed

+2889
-1962
lines changed

.github/workflows/CI.yml

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: SeleniumLibrary CI
22

3-
on: [push, pull_request]
3+
on: workflow_dispatch
44

55
jobs:
66
build:
@@ -9,10 +9,11 @@ jobs:
99
continue-on-error: true
1010
strategy:
1111
matrix:
12-
python-version: [3.8, 3.12] # pypy-3.9
13-
rf-version: [6.1.1, 7.0.1]
14-
selenium-version: [4.21.0, 4.22.0, 4.23.1, 4.24.0]
15-
browser: [firefox, chrome, headlesschrome] #edge
12+
python-version: [3.9.23, 3.13.5, 3.14.0-rc.3] # pypy-3.9
13+
# python-version: [{earliest: 3.9}, {latest: 3.13.0}] # pypy-3.9
14+
rf-version: [6.1.1, 7.3.2]
15+
selenium-version: [4.28.1, 4.29.0, 4.30.0, 4.31.0, 4.32.0, 4.33.0, 4.34.2]
16+
browser: [chrome] # firefox, chrome, headlesschrome, edge
1617

1718
steps:
1819
- uses: actions/checkout@v4
@@ -21,9 +22,11 @@ jobs:
2122
with:
2223
python-version: ${{ matrix.python-version }}
2324
- name: Setup Chrome
24-
uses: browser-actions/setup-chrome@latest
25+
uses: browser-actions/setup-chrome@v1
2526
with:
26-
chrome-version: latest
27+
chrome-version: 138
28+
install-dependencies: true
29+
install-chromedriver: true
2730
id: setup-chrome
2831
- run: |
2932
echo Installed chromium version: ${{ steps.setup-chrome.outputs.chrome-version }}
@@ -75,8 +78,13 @@ jobs:
7578
run: |
7679
xvfb-run --auto-servernum python atest/run.py --nounit --zip headlesschrome
7780
78-
- name: Run tests with ${{ matrix.browser }} if CPython
79-
if: startsWith( matrix.python-version, 'pypy') == false
81+
# - name: Run tests with ${{ matrix.browser }} if CPython
82+
# if: startsWith( matrix.python-version, 'pypy') == false
83+
# run: |
84+
# xvfb-run --auto-servernum python atest/run.py --zip ${{ matrix.browser }}
85+
86+
- name: Run tests with latest python and latest robot framework
87+
if: matrix.python-version == '3.13.0' && matrix.rf-version == '7.2.2'
8088
run: |
8189
xvfb-run --auto-servernum python atest/run.py --zip ${{ matrix.browser }}
8290
@@ -87,8 +95,9 @@ jobs:
8795
# sudo chmod u+x ./selenium-server-standalone.jar
8896
# xvfb-run --auto-servernum python atest/run.py --zip headlesschrome --grid True
8997

90-
- uses: actions/upload-artifact@v3
98+
- uses: actions/upload-artifact@v4
9199
if: failure()
92100
with:
93-
name: SeleniumLibrary Test results
101+
name: sl_$${{ matrix.python-version }}_$${{ matrix.rf-version }}_$${{ matrix.selenium-version }}_$${{ matrix.browser }}
94102
path: atest/zip_results
103+
overwrite: true

.github/workflows/Select.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Selected Test Configuration Matrix
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test_config:
7+
runs-on: ubuntu-latest
8+
continue-on-error: true
9+
strategy:
10+
matrix:
11+
config:
12+
- description: latest
13+
python-version: 3.13.10
14+
rf-version: 7.4.1
15+
selenium-version: 4.39.0
16+
browser: chrome
17+
- description: previous
18+
python-version: 3.12.12
19+
rf-version: 7.3.2
20+
selenium-version: 4.38.0
21+
browser: chrome
22+
- description: older_rf_version
23+
python-version: 3.11.14
24+
rf-version: 6.1.1
25+
selenium-version: 4.37.0
26+
browser: chrome
27+
28+
steps:
29+
- uses: actions/checkout@v4
30+
- name: Configuration Description
31+
run: |
32+
echo "${{ matrix.config.description }} configuration"
33+
echo "Testing with RF v${{ matrix.config.rf-version }}, Selenium v${{ matrix.config.selenium-version}}, Python v${{ matrix.config.python-version }} under ${{ matrix.config.browser }}"
34+
- name: Set up Python ${{ matrix.config.python-version }}
35+
uses: actions/setup-python@v5
36+
with:
37+
python-version: ${{ matrix.config.python-version }}
38+
- name: Setup ${{ matrix.config.browser }} browser
39+
uses: browser-actions/setup-chrome@v1
40+
with:
41+
chrome-version: latest
42+
install-dependencies: true
43+
id: setup-chrome
44+
- run: |
45+
echo Installed chromium version: ${{ steps.setup-chrome.outputs.chrome-version }}
46+
${{ steps.setup-chrome.outputs.chrome-path }} --version
47+
- name: Setup firefox
48+
id: setup-firefox
49+
uses: browser-actions/setup-firefox@v1
50+
with:
51+
firefox-version: latest
52+
- run: |
53+
echo Installed firefox versions: ${{ steps.setup-firefox.outputs.firefox-version }}
54+
${{ steps.setup-firefox.outputs.firefox-path }} --version
55+
- name: Start xvfb
56+
run: |
57+
export DISPLAY=:99.0
58+
Xvfb -ac :99 -screen 0 1280x1024x16 > /dev/null 2>&1 &
59+
- name: Install dependencies
60+
run: |
61+
python -m pip install --upgrade pip
62+
pip install -r requirements-dev.txt
63+
- name: Install Seleninum v${{ matrix.config.selenium-version }}
64+
run: |
65+
pip install --upgrade selenium==${{ matrix.config.selenium-version }}
66+
- name: Install RF ${{ matrix.config.rf-version }}
67+
run: |
68+
pip install -U --pre robotframework==${{ matrix.config.rf-version }}
69+
70+
- name: Run tests under specified config
71+
run: |
72+
xvfb-run --auto-servernum python atest/run.py --zip ${{ matrix.config.browser }}
73+
74+
- uses: actions/upload-artifact@v4
75+
if: failure()
76+
with:
77+
name: sl_$${{ matrix.config.python-version }}_$${{ matrix.config.rf-version }}_$${{ matrix.config.selenium-version }}_$${{ matrix.config.browser }}
78+
path: atest/zip_results
79+
overwrite: true

README.rst

Lines changed: 5 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SeleniumLibrary_ is a web testing library for `Robot Framework`_ that
1010
utilizes the Selenium_ tool internally. The project is hosted on GitHub_
1111
and downloads can be found from PyPI_.
1212

13-
SeleniumLibrary currently works with Selenium 4. It supports Python 3.8 through 3.12.
13+
SeleniumLibrary currently works with Selenium 4. It supports Python 3.8 through 3.13.
1414
In addition to the normal Python_ interpreter, it works also
1515
with PyPy_.
1616

@@ -44,8 +44,7 @@ The recommended installation method is using pip_::
4444
pip install --upgrade robotframework-seleniumlibrary
4545

4646
Running this command installs also the latest Selenium and Robot Framework
47-
versions, but you still need to install `browser drivers`_ separately.
48-
The ``--upgrade`` option can be omitted when installing the library for the
47+
versions. The ``--upgrade`` option can be omitted when installing the library for the
4948
first time.
5049

5150
It is possible to install directly from the GitHub_ repository. To install
@@ -64,39 +63,11 @@ using ``pip`` see `its own documentation <pip_>`__.
6463
Browser drivers
6564
---------------
6665

67-
After installing the library, you still need to install browser and
68-
operating system specific browser drivers for all those browsers you
69-
want to use in tests. These are the exact same drivers you need to use with
70-
Selenium also when not using SeleniumLibrary. More information about
71-
drivers can be found from `Selenium documentation`__.
72-
73-
The general approach to install a browser driver is downloading a right
74-
driver, such as ``chromedriver`` for Chrome, and placing it into
75-
a directory that is in PATH__. Drivers for different browsers
76-
can be found via Selenium documentation or by using your favorite
77-
search engine with a search term like ``selenium chrome browser driver``.
78-
New browser driver versions are released to support features in
79-
new browsers, fix bug, or otherwise, and you need to keep an eye on them
80-
to know when to update drivers you use.
81-
82-
Alternatively, you can use a tool called WebdriverManager__ which can
83-
find the latest version or when required, any version of appropriate
84-
webdrivers for you and then download and link/copy it into right
85-
location. Tool can run on all major operating systems and supports
86-
downloading of Chrome, Firefox, Opera & Edge webdrivers.
87-
88-
Here's an example:
89-
90-
.. code:: bash
91-
92-
pip install webdrivermanager
93-
webdrivermanager firefox chrome --linkpath /usr/local/bin
94-
95-
66+
Browsers and drivers are installed and managed automatically by `Selenium Manager`__.
67+
For more information, see the `Selenium documentation`__.
9668

69+
__ https://www.selenium.dev/documentation/selenium_manager
9770
__ https://seleniumhq.github.io/selenium/docs/api/py/index.html#drivers
98-
__ https://en.wikipedia.org/wiki/PATH_(variable)
99-
__ https://github.com/omenia/webdrivermanager
10071

10172
Usage
10273
-----

atest/acceptance/keywords/alerts.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Handle Alert returns message
4343

4444
Handle Alert with custom timeout
4545
Click Button Slow alert
46-
Handle Alert timeout=1s
46+
Handle Alert timeout=2s
4747
Click Button Slow alert
4848
Run Keyword And Expect Error
4949
... Alert not found in 1 millisecond.

atest/acceptance/keywords/cookies.robot

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,21 @@ Add Cookie When Secure Is False
3636
Should Be Equal ${cookie.secure} ${False}
3737

3838
Add Cookie When Expiry Is Epoch
39-
Add Cookie Cookie1 value1 expiry=1730205247
39+
# To convert epoch to formatted string
40+
# from time import strftime, localtime
41+
# strftime('%Y-%m-%d %H:%M:%S', localtime(1793247900))
42+
# To update time each September (as Chrome limits cookies to one year expiry date) use
43+
# import datetime
44+
# print (datetime.datetime.strptime("2027-10-29 12:25:00", "%Y-%m-%d %I:%M:%S").timestamp())
45+
Add Cookie Cookie1 value1 expiry=1793247900
4046
${cookie} = Get Cookie Cookie1
41-
${expiry} = Convert Date ${1730205247} exclude_millis=True
47+
${expiry} = Convert Date ${1793247900} exclude_millis=True
4248
Should Be Equal As Strings ${cookie.expiry} ${expiry}
4349

4450
Add Cookie When Expiry Is Human Readable Data&Time
45-
Add Cookie Cookie12 value12 expiry=2024-10-29 19:36:51
51+
Add Cookie Cookie12 value12 expiry=2026-10-29 12:25:00
4652
${cookie} = Get Cookie Cookie12
47-
Should Be Equal As Strings ${cookie.expiry} 2024-10-29 19:36:51
53+
Should Be Equal As Strings ${cookie.expiry} 2026-10-29 12:25:00
4854

4955
Delete Cookie
5056
[Tags] Known Issue Safari
@@ -114,17 +120,20 @@ Test Get Cookie Keyword Logging
114120
... domain=localhost
115121
... secure=False
116122
... httpOnly=False
117-
... expiry=2024-09-15 *:22:33
123+
... expiry=2026-09-01 *:25:00
118124
... extra={'sameSite': 'Lax'}
119125
${cookie} = Get Cookie far_future
120126

121127
*** Keywords ***
122128
Add Cookies
129+
# To update time each September (as Chrome limits cookies to one year expiry date) use
130+
# import datetime
131+
# print (datetime.datetime.strptime("2027-09-01 12:25:00", "%Y-%m-%d %I:%M:%S").timestamp())
123132
Delete All Cookies
124133
Add Cookie test seleniumlibrary
125134
${now} = Get Current Date
126135
${tomorrow_thistime} = Add Time To Date ${now} 1 day
127136
${tomorrow_thistime_datetime} = Convert Date ${tomorrow_thistime} datetime
128137
Set Suite Variable ${tomorrow_thistime_datetime}
129138
Add Cookie another value expiry=${tomorrow_thistime}
130-
Add Cookie far_future timemachine expiry=1726399353 # 2024-09-15 11:22:33
139+
Add Cookie far_future timemachine expiry=1788236700 # 2026-09-01 12:25:00

atest/acceptance/keywords/expected_conditions.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Wait For Expected Conditions One Argument
1010
Title Should Be Delayed
1111
1212
Wait For Expected Condition Times out within set timeout
13-
[Documentation] FAIL REGEXP: TimeoutException: Message: Expected Condition not met within set timeout of 0.3*
13+
[Documentation] FAIL STARTS: TimeoutException: Message: Expected Condition not met within set timeout of 0.3
1414
Title Should Be Original
1515
Click Element link=delayed change title
1616
Wait For Expected Condition title_is Delayed timeout=0.3

atest/acceptance/keywords/mouse.robot

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Resource ../resource.robot
88
Mouse Over
99
[Tags] Known Issue Safari
1010
Mouse Over el_for_mouseover
11+
Sleep 0.1secs
1112
Textfield Value Should Be el_for_mouseover mouseover el_for_mouseover
1213
Run Keyword And Expect Error
1314
... Element with locator 'not_there' not found.
@@ -16,6 +17,7 @@ Mouse Over
1617
Mouse Over Error
1718
[Tags] Known Issue Safari
1819
Mouse Over el_for_mouseover
20+
Sleep 0.1secs
1921
Textfield Value Should Be el_for_mouseover mouseover el_for_mouseover
2022
Run Keyword And Expect Error
2123
... Element with locator '鱼在天空中飞翔' not found.

atest/acceptance/keywords/run_on_failure.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Run on Failure Returns Previous Value
6767
Should Be Equal ${old} Log Title
6868

6969
Run On Failure also fails
70-
[Documentation] LOG 2.1 WARN Keyword 'Failure During Run On failure' could not be run on failure: Expected error.
70+
[Documentation] LOG 2.1.2 WARN Keyword 'Failure During Run On failure' could not be run on failure: Expected error.
7171
Register Keyword to Run on Failure Failure During Run On failure
7272
Run Keyword And Expect Error
7373
... ${FAILURE MESSAGE}

atest/acceptance/keywords/textfields.robot

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
*** Settings ***
2+
Suite Setup Open Browser To Start Page Disabling Chrome Leaked Password Detection
23
Test Setup Go To Page "forms/prefilled_email_form.html"
34
Resource ../resource.robot
45
Force Tags Known Issue Internet Explorer
@@ -75,3 +76,10 @@ Press Key
7576

7677
Attempt Clear Element Text On Non-Editable Field
7778
Run Keyword And Expect Error * Clear Element Text can_send_email
79+
80+
*** Keywords ***
81+
82+
Open Browser To Start Page Disabling Chrome Leaked Password Detection
83+
[Arguments] ${alias}=${None}
84+
Open Browser ${FRONT PAGE} ${BROWSER} remote_url=${REMOTE_URL}
85+
... options=add_experimental_option("prefs", {"profile.password_manager_leak_detection": False}) alias=${alias}

atest/acceptance/locators/custom.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ Teardown Custom Locator
5555
Custom Locator Strategy
5656
[Arguments] ${browser} ${locator} ${tag} ${constraints}
5757
${element}= Execute Javascript return window.document.getElementById('${locator}') || [];
58-
[Return] ${element}
58+
RETURN ${element}

0 commit comments

Comments
 (0)