TG3017
TG3017

Reputation: 33

How can we open a URL in Chrome Icognito mode using Robot Framework

Can anyone please help me how to open a URL in Chrome browser in Icognito mode, as the URL that i'm trying to open in chrome is giving 404 error but is opening successfully in Icognito. Please guide me what Robot command should be given to open in Icognito mode. Thank you.

Upvotes: 0

Views: 6315

Answers (3)

T-2021
T-2021

Reputation: 23

This should work:

Open Browser | ${url} | Chrome | options=add_argument("--incognito")

Upvotes: 1

asprtrmp
asprtrmp

Reputation: 1062

    ${options}=    Evaluate  sys.modules['selenium.webdriver'].ChromeOptions()  sys, selenium.webdriver
    Call Method    ${options}    add_argument    incognito
    Create WebDriver    Chrome    chrome_options=${options}
    Go To    https://www.google.com

Upvotes: 2

Andrea
Andrea

Reputation: 49

Robotframework always creates a 'clean' session of chrome so it shouldn't make a difference.

If you still want to run a incognito session, you could set --incognito option:

Open Browser      ${url}      Chrome     options=addArguments("--incognito")

You can find what you can pass to the browser here: http://robotframework.org/SeleniumLibrary/SeleniumLibrary.html#Open%20Browser

Upvotes: -1

Related Questions