MarketSquare / robotframework-seleniumlibrary-java

Java port of the Python based SeleniumLibrary for Robot Framework
Apache License 2.0
23 stars 16 forks source link

Chrome Headless: Remote Debugging? #85

Closed homerlex closed 5 years ago

homerlex commented 5 years ago

When using chromeheadless, is there any way to enable the --remote-debugging-port param so we can debug what the headless browser is "seeing" ?

Hi-Fi commented 5 years ago

Here's full example of test that uses the argument. So answer to question is "using browserOptions".

*** Settings ***
Library    SeleniumLibrary
Library    String

*** Test Cases ***
Test remote debugging
    ${browserOptions}=    Catenate   
    ...    {
    ...        "args": [ "--remote-debugging-port=4444"  ],
    ...        "extensions": [  ],
    ...        "prefs": {}
    ...    }
    Log    ${browserOptions}
    Open Browser    http://www.google.com    chromeheadless    browserOptions=${browserOptions}   isWebDriverManager=${True}
    Sleep    20s    
    Capture Page Screenshot
    Close All Browsers
homerlex commented 5 years ago

Perfect Thanks!