Now temporary folder created in C:\Program Files when using Selenium to automate Edge

瑞峰 孟 20 Reputation points
2023-02-19T11:43:52.78+00:00

Microsoft Edge version 110.0.1587.50 (Official build) (64-bit)

webdriver:110.0.1587.50 (64bit)

python3.9.0 selenium: 4.8.2

When the edge driver before January 31 uses selenium and python for browser automation testing, if webdriver.Edge does not specify a user profile, a temporary folder will be created in the C:\Users***\AppData\Local\Temp, such as scoped_ dir1604_ 47279065. Now, the files created in the C:\Program Files. How to change back to the original default when no user profile is specified, and put the temporary profile in the C:\Users*\AppData\Local\Temp directory. I think the browser driver may have changed the default settings in the new version.**

Microsoft Edge Microsoft Edge development
{count} votes

Accepted answer
  1. Anonymous
    2023-02-20T07:41:04.7933333+00:00

    Hi @瑞峰 孟

    Yes, now the temp profile is under C:\Program Files. I think that's defined in browser or browser driver's source code and we can't change it.

    As a workaround, I suggest that you can define a test profile path and always use that profile for automation tests. For example, you can use code edge_options.add_argument("user-data-dir=C:\\Users\\username\\AppData\\Local\\Temp"), it will create a new Default profile under that path. You can always use that profile for automation tests. If you don't need that profile one day, you can also delete the profile folder manually.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Regards,

    Yu Zhou

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.