Search code examples
robotframeworkheadless

Headless testing in Robot Framework


I opted to just ask my question directly here, I'm quite confused with all the details I've gathered regarding headless testing in robot framework.

Is there a documentation that has all the instruction on how to implement headless testing in Robot Framework from scratch? Like what are the needed pre-requisites?like xvfb?or anything else?Hope you can help me. Thanks

By the way, I'm currently using Robot Framework with pycharm as ide in(Windows OS). Thank You


Solution

  • Personally I just use headless Chrome:

    ${chromeOptions}=    Evaluate    sys.modules['selenium.webdriver'].ChromeOptions()    sys, selenium.webdriver
    ${prefs} =    Create Dictionary    download.default_directory=${downloadDir}
    Call Method    ${chromeOptions}    add_experimental_option    prefs    ${prefs}
    Call Method    ${chromeOptions}    add_argument    --lang\=${browserLocale}
    Call Method    ${chromeOptions}    add_argument    --headless
    Call Method    ${chromeOptions}    add_argument    --window-size\=1366,768
    Call Method    ${chromeOptions}    add_argument    --disable-gpu
    Create Webdriver    ${browserName}    chrome_options=${chromeOptions}