Reputation: 11
I am using Protractor and newbie to it I have installed protractor using npm i -g protractor webdriver-manager update webdriver-manager start
when I run protractor conf_master.js I am getting following error
[chrome #01-1] [20:01:12] I/local - Starting selenium standalone server...
[chrome #01-1] [20:01:16] I/local - Selenium standalone server started at http://10.289.122.156:21199/wd/hub
[chrome #01-1]
[chrome #01-1] /data/home/aflsexchange/node-v10.15.3-linux-x64/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:546
[chrome #01-1] throw new ctor(message);
[chrome #01-1] ^
[chrome #01-1] WebDriverError: unknown error: cannot create temp dir for user data dir
[chrome #01-1] Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
[chrome #01-1] System info: host: '<myurl>', ip: '10.247.189.139', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-1062.1.2.el7.x86_64', java.version: '1.8.0_161'
[chrome #01-1] Driver info: driver.version: unknown
[chrome #01-1] remote stacktrace: #0 0x55f67c8507e9 <unknown>
[chrome #01-1]
I am using Linux machine. Please let me know about the solution
Upvotes: 1
Views: 3450
Reputation: 2021
Usually this problem is related to the permissions please use custom user-data-dir below you will find small example solved problem for me
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--headless')
chrome_options.add_argument('--disable-gpu')
chrome_options.add_argument('--disable-dev-shm-usage')
chrome_options.add_argument('--profile-directory=Default')
chrome_options.add_argument('--user-data-dir=~/.config/google-chrome')
driver = webdriver.Chrome(options=chrome_options)
url = 'https://www.google.com'
driver.get(url)
get_url = driver.current_url
print(get_url)
Upvotes: 0
Reputation: 193108
This error message...
WebDriverError: unknown error: cannot create temp dir for user data dir
...implies that the ChromeDriver was unable to create a temporary directory while trying to initiate/spawn a new WebBrowser i.e. Chrome Browser session.
This error can occur due to different configuration issues or incompatibility between the version of the binaries you are using.
Ensure that:
@Test
as non-root user (preferably with root/admin priviledge).driver.quit()
within tearDown(){}
method to close & destroy the WebDriver and Web Client instances gracefully.Upvotes: 1