Error using Pabot Shared Library with Selenium

Hi all,
I’m writing to you because I’m trying to use pabot.SharedLibrary with Selenium. The goal would be to create a shared instance of a browser used by N test cases executed in parallel with pabot.
This is a snippet:

*** Settings ***
Library pabot.PabotLib
Library pabot.SharedLibrary SeleniumLibrary

Suite Setup Run Setup Only Once Open Chrome
Suite Teardown Run Teardown Only Once Close Browser

*** Keywords ***
Open Chrome
${chrome_options}= Evaluate selenium.webdriver.ChromeOptions() modules=selenium, selenium.webdriver
Call Method ${chrome_options} add_argument --enable-automation
Call Method ${chrome_options} add_argument --start-maximized
Call Method ${chrome_options} add_argument --headless
Call Method ${chrome_options} add_argument --ignore-certificate-errors
Call Method ${chrome_options} add_argument --no-sandbox
Call Method ${chrome_options} add_argument --disable-dev-shm-usage
Call Method ${chrome_options} add_argument --disable-gpu
Call Method ${chrome_options} add_argument --disable-extensions
Call Method ${chrome_options} add_argument --disable-infobars
Call Method ${chrome_options} add_argument --disable-application-cache

Create Webdriver    Chrome    options=${chrome_options}

*** Test Cases ***
Test shared library
[Tags] sharedlibrary
Go To Mock SAML Identity Provider - Login
Wait Until Element Is Visible xpath=//button[text()=‘Sign In’]
Click Button xpath=//button[text()=‘Sign In’]

Unfortunately, I got an expected error: TypeError: WaitingKeywords.wait_until_element_is_visible() got an unexpected keyword argument ‘xpath’, if I comment the Wait Until Element Is Visible I obtain this error: TypeError: ElementKeywords.click_button() got an unexpected keyword argument ‘xpath’.

Instead, executing same test without SharedLibrary it works. I’m using python 3.11.2, robotframework-pabot==2.16.0 and robotframework-seleniumlibrary==6.1.2.

Could someone help me?
Thanks.

1 Like

Multiple instances of SeleniumLibrary (eg, running from Pabot) cannot share a single instance of webdriver and browser instance. Each pabot runner needs to have its own instance of webdriver that talks to a single instance of a browser or into single node in Selenium Grid …

1 Like

Hi,
Thanks for the reply. I was trying to follow this: One suite setup, parallel testlevelsplit - Extensions / Pabot - Robot Framework

Best regards.