Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recipe suggestion for chrome driver desired capabilities options #54

Open
avinashravi96 opened this issue Jul 20, 2021 · 0 comments
Open

Comments

@avinashravi96
Copy link

avinashravi96 commented Jul 20, 2021

In recent times i have tried downloading pdf files from chrome and got stuck with setting chrome options in robot framework.
Did searched through all possible ways and found the solutions. which took lot of time to understand the syntax in robot.
Please add recipes for different types of driver setup in robot framework with all desired capabilities. it will be lot useful for beginners. Attaching code snippet am using now for reference.

*** Variables ***
${BROWSER}                  chrome
${DOWNLOAD_DIR}             ${CURDIR}/../temp
${REMOTE URL}               http://127.0.0.1:4444/wd/hub
&{OPTION}
&{DESIRED_CAPABILITIES}     name=browserTest    enableVNC=${True}

*** Keywords ***
Login To OMS
    [Documentation]    login for oms
    ${profile}    Create dictionary    enabled=${False}    name=Chrome PDF Viewer
    ${list profile}    Create list    ${profile}
    ${prefs}    Create Dictionary    plugins.plugins_list=${list profile}
    ...    plugins.always_open_pdf_externally=${True}
    ...    download.extensions_to_open=applications/pdf    download.prompt_for_download=${False}
    ...    safebrowsing.enabled=${True}    download.default_directory=/../temp
    ${chrome options}    Evaluate    sys.modules['selenium.webdriver'].ChromeOptions()    sys, selenium.webdriver
    Call Method    ${chrome options}    add_experimental_option    prefs    ${prefs}
    Open Browser    ${LOGIN URL}    ${BROWSER}    desired_capabilities=${DESIRED_CAPABILITIES}
    ...    options=${chrome options}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant