Skip to content

Attach Pylenium to an existing browser #193

Answered by ElSnoMan
serdnago asked this question in Q&A
Discussion options

You must be logged in to vote

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 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:

def test_example(py: Pylenium):
    py.config.driver.experimental_options = {"debuggerAddress": 12345}
    # you are now on the existing browser session
    ...

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@serdnago
Comment options

Answer selected by ElSnoMan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants