SeleniumBasic icon indicating copy to clipboard operation
SeleniumBasic copied to clipboard

I cannot set my default profile in Edge using Selenium in VBA

Open gremonfe opened this issue 2 years ago • 5 comments

For some reason I cannot set my default profile in Edge using Selenium in VBA (Excel), tried with .SetProfile, with .AddArgument but it keeps generating a temporary profile.

With Chrome works though.

Did someone manage to make it work with Edge?

thanks

gremonfe avatar Apr 04 '22 23:04 gremonfe

这是来自QQ邮箱的假期自动回复邮件。 已经收到,等我看到了,立马回复。 

wolflash666 avatar Apr 04 '22 23:04 wolflash666

I got my gastritis back trying to open Edge with the local profile. Yes, with Chrome works. I think it is a bug.

rufogil avatar May 06 '22 07:05 rufogil

I was able to pull this off by adding the same ExtendCapabilities functions in the ChromeDriver.cs to the EdgeDriver.cs. After doing this, you just need to rebuild the solution and install. In VBA execution, the "user-data-dir" argument works as expected for Edge.

longvh211 avatar May 10 '22 12:05 longvh211

@longvh211 I'm getting lots of errors when I try to build even the original unedited solution. Can you share how you were able to do this?

Here's the errors I got: 1>------ Rebuild All started: Project: Selenium, Configuration: Debug Any CPU ------ 1> Selenium -> G:\excelvbaisfun\Complete Web Automation Excel VBA\SeleniumBasic-master\SeleniumBasic-master\Selenium\bin\Debug\Selenium.dll 1> File not found - firefoxdriver.xpi 1> 0 File(s) copied 1> File not found - chromedriver.exe 1> 0 File(s) copied 1> File not found - operadriver.exe 1> 0 File(s) copied 1> File not found - iedriver.exe 1> 0 File(s) copied 1> File not found - iedriver64.exe 1> 0 File(s) copied 1> File not found - phantomjs.exe 1> 0 File(s) copied 1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(5258,5): error MSB3073: The command "xcopy /D /Y "G:\excelvbaisfun\Complete Web Automation Excel VBA\SeleniumBasic-master\SeleniumBasic-master\Selenium\..\References\firefoxdriver.xpi" . 1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(5258,5): error MSB3073: xcopy /D /Y "G:\excelvbaisfun\Complete Web Automation Excel VBA\SeleniumBasic-master\SeleniumBasic-master\Selenium\..\References\chromedriver.exe" . 1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(5258,5): error MSB3073: xcopy /D /Y "G:\excelvbaisfun\Complete Web Automation Excel VBA\SeleniumBasic-master\SeleniumBasic-master\Selenium\..\References\operadriver.exe" . 1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(5258,5): error MSB3073: xcopy /D /Y "G:\excelvbaisfun\Complete Web Automation Excel VBA\SeleniumBasic-master\SeleniumBasic-master\Selenium\..\References\iedriver.exe" . 1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(5258,5): error MSB3073: xcopy /D /Y "G:\excelvbaisfun\Complete Web Automation Excel VBA\SeleniumBasic-master\SeleniumBasic-master\Selenium\..\References\iedriver64.exe" . 1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(5258,5): error MSB3073: xcopy /D /Y "G:\excelvbaisfun\Complete Web Automation Excel VBA\SeleniumBasic-master\SeleniumBasic-master\Selenium\..\References\phantomjs.exe" ." exited with code 4. 2>------ Skipped Rebuild All: Project: Selenium.Tests, Configuration: Debug Any CPU ------ 2>Project not selected to build for this solution configuration 3>------ Skipped Rebuild All: Project: VbsConsole, Configuration: Debug Any CPU ------ 3>Project not selected to build for this solution configuration ========== Rebuild All: 0 succeeded, 1 failed, 2 skipped ==========

dantheinfoman avatar Jun 07 '22 19:06 dantheinfoman

@dantheinfoman this is because there are files missing. You can have a look at my branch here in which I provided some instructions on rebuilding this.

By the way, if you are fire-fighting the June 15 event for a good method that can directly automate Chromium-based browsers or Edge IE Mode without installing another software, you can have a look at my StackOverflow reply here. I have prepared many helpful demo files in this article for us all to quickly get on board with these methods.

longvh211 avatar Jun 08 '22 03:06 longvh211