-
Is it possible to attach Pylenium to an existing browser session? We have some tests that require mocking some calls (using selenium-wire). The tests start the browser, hit some URLs, mock some of the requests/responses and then proceed to regular UI testing. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
With Selenium, you pass in the debug port of the existing browser session: chromeOptions options = new ChromeOptions();
options.setExperimentalOption("debuggerAddress", "127.0.0.1:1111");
WebDriver driver = new ChromeDriver(options); So, with Pylenium, once you have the debug port, you can either use def test_example(py: Pylenium):
py.config.driver.experimental_options = {"debuggerAddress": 12345}
# you are now on the existing browser session
... |
Beta Was this translation helpful? Give feedback.
With Selenium, you pass in the debug port of the existing browser session:
So, with Pylenium, once you have the debug port, you can either use
pylenium.json
to have all tests run against the current browser by setting the Experimental Options as seen in the docs, or you can control it at just the test level: