0

I tried below code but its downloaded and save it the path we configured in pip list [2nd line of code]. Instead of auto download in my local machine, I want to download directly into project directory because of few restriction issues in my organisation. Can anyone provide suggestions on this?

pip install webdrivermanager

webdrivermanager firefox chrome --linkpath /usr/local/bin

from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager

def get_chromedriver_path():
    driver_path = ChromeDriverManager().install()
    print(driver_path)
    return  driver_path

Library  chromedriversync.py

${chromedriver_path}=   chromedriversync.Get Chromedriver Path
Create Webdriver    chrome   executable_path=${chromedriver_path}
Go to  www.google.com

Pari
  • 19
  • 8

1 Answers1

0

Finally I got the solution. Below query helped me to auto download .exe files of the respective browser version to Project Current directory.

from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from lib2to3.tests.support import driver
import os
import os.path
from os.path import curdir

def get_chromedriver_path():
    ReturnPath = os.getcwd()
    driver_path = ChromeDriverManager(path=ReturnPath).install()
    print(driver_path)
    return driver_path


Library    browser 
    ${driver}=    browser.Get Chromedriver Path
    log    ${driver}  
    Create Webdriver    Chrome    executable_path=${driver}    chrome_options=${options} 

Pari
  • 19
  • 8