6

I am getting below error while running the code. I am using cucumber ruby capybara framework.If there is any solutions please do answer. Thanks a lot.

Error is as below:

Unknown error: cannot create temp dir for user data dir (Driver info: chromedriver=2.33.506120 (e3e53437346286c0bc2d2dc9aa4915ba81d9023f),platform=Windows NT 10.0.14393 x86_64) (Selenium::WebDriver::Error::UnknownError)

1
  • 2
    The user account that is running the chromedriver does not have permission to make changes to the Chrome profile directory. Commented Nov 14, 2017 at 19:50

3 Answers 3

7

I was facing the same issue with chrome drivers. Following are the cases that I found could lead to this issue:

  • Missing TEMP or TMP environment variables
  • TEMP or TMP is mapped not to local NTFS drive
  • Permission issue (if you are using user other than the logged in user)
  • TEMP or TMP invalid path

In my case TEMP was mapped to C:\Users\MyUser\AppData\Local\Temp\MyFolder. So when the Temp folder got cleared, MyFolder folder also got deleted and chromedriver threw "Unknown error: cannot create temp dir for user data dir" . By creating a new folder with name "MyFolder" in Temp folder fixed my issue.

TEMP and TMP path can be verified at

My Computer -> Properties -> Advanced System settings -> Environment Variables -> Variables used for < your user >

Or else you can check it by entering "%temp%" in "Run" window.

Its better to check path using both ways because I have seen some cases where temp path set in environment variable and path of folder that opens on executing %temp% command via Run were different.

Hope it helps.

Sign up to request clarification or add additional context in comments.

1 Comment

this work, however, the folder name may not called as myfolder, i tried to key in %temp% in run to make sure what is the missing folder
0

I met same issue and solved it now. I checked the path of TEMP dirctory according to many online suggestions.

  • Check Environment Variable
  • Run command echo %temp%

The important thing I found that sometimes the paths are different in above two methods.(I never edited this path before checking it) In my case:

  • Check Environment Variable C:\Users\Administrator\AppData\Local\Temp
  • Run command echo %temp% C:\Users\Administrator\AppData\Local\Temp\4

So I checked the Temp directory and there wasn't 4 folder. I created 4 folder manually in the Temp directory and the issue was solved. Of course, this is the case of Administrator. I haven't checked the case of user, but hope it helpful for the case too.

Comments

-1

Quick fix: running IntelliJ as admin solved my problem!

1 Comment

That is not really an approach to recommend.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.