Rohit sai
Rohit sai

Reputation: 129

What are the capabilities of the browser opened by selenium-webdriver?

I am curious to know the capabilities of the Chrome browser opened through the code:

driver=webdriver.chromedriver()

Is it same as that of incognito mode or is there a different kind?

Upvotes: 1

Views: 2282

Answers (1)

undetected Selenium
undetected Selenium

Reputation: 193138

To extract the capabilities of the ChromeDriver / Chrome Browser you can use the capabilities property which returns a dictionary and you can use the following solution:

  • Code Block:

    from selenium import webdriver
    
    driver = webdriver.Chrome(executable_path="C:\\Utility\\BrowserDrivers\\chromedriver.exe")
    my_dict = driver.capabilities
    for key,val in my_dict.items():
        print (key, "=>", val)
    driver.quit()
    
  • Console Output:

    acceptInsecureCerts => False
    browserName => chrome
    browserVersion => 76.0.3809.100
    chrome => {'chromedriverVersion': '76.0.3809.68 (420c9498db8ce8fcd190a954d51297672c1515d5-refs/branch-heads/3809@{#864})', 'userDataDir': 'C:\\Users\\Debanjan.B\\AppData\\Local\\Temp\\scoped_dir3888_683123771'}
    goog:chromeOptions => {'debuggerAddress': 'localhost:26050'}
    networkConnectionEnabled => False
    pageLoadStrategy => normal
    platformName => windows nt
    proxy => {}
    setWindowRect => True
    strictFileInteractability => False
    timeouts => {'implicit': 0, 'pageLoad': 300000, 'script': 30000}
    unhandledPromptBehavior => dismiss and notify
    

You can find a relevant discussion in How to provide custom capabilities on the selenium server?

Upvotes: 1

Related Questions