I wrote an application in C# to automate logging on to a webpage.
It works perfectly whenever an Admin runs the executable. Whenever a non-admin runs the project, it's as if IEDriver.exe doesn't launch. There are no restrictions of launching IEDriver.exe from a group policy.
private IWebDriver _driver;
public void SetUp()
{
InternetExplorerOptions options = new InternetExplorerOptions();
options.EnsureCleanSession = true;
options.IntroduceInstabilityByIgnoringProtectedModeSettings = true;
options.RequireWindowFocus = true;
options.EnablePersistentHover = false;
var service = InternetExplorerDriverService.CreateDefaultService();
service.LibraryExtractionPath = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
//service.HideCommandPromptWindow = true;
_driver = new InternetExplorerDriver(service, options);
}
when I uncomment the LibraryExtractionPath, IEDriver doesn't launch.
When I debug the code.
Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
points to the correct location which is
D:\PathToFolder\Project1\bin\Debug\
I think the problem is that the clients (as non-admin) are unable to launch IEDriver.exe
UPDATE: Internet Explorer's Protected Mode is not disabled, which can prevent running IE Driver as a non-admin user. Can I disable it using C# code and IE service options?
These are capabilities and features specific to Microsoft Internet Explorer browsers. As of June 2022, Selenium officially no longer supports standalone Internet Explorer. The Internet Explorer driver still supports running Microsoft Edge in “IE Compatibility Mode.”
The Selenium Project will not remove support for IE 11 when it retires but we will not actively fix issues as we have done with previous versions of IE. The Microsoft Edge team have committed to supporting IE Mode in Edge until 2029 when support for Windows 10 is retired.
From the looks of the path you have supplied
D:\PathToFolder\Project1\bin\Debug\
You are trying to run the driver from where it hase been compiled by Visual Studio. There are a couple of reasons why this may not work.
When you setup and compiled the code in visual studio it would have created the debug folder ect and used the permissions of the current user. This means that that user and Admins may be able to access it but no body else. Or if this was done as an Admin it may only be accessible to admins.
Quiet often Visual Studio and other IDEs will also have a different working directory and compile the exe into different directories depending on what build options you have selected. For example release versus debug. What this means is that dll's ect used by the exe are not in the same diretory as the exe. When you run inside visual studio this isn't a problem as it set the correct working directory and sorts it all out for you. In your case it is probably not quiet that simple if this is part of the problem. What it might mean is that any requisite dll's ect might be installed and in the path for the Admin but not for normal users.
What this breaks down to is this is likely a path or permissions issue. I would suggest using something like Dependency walker to see what the of the exe are: http://www.dependencywalker.com/ and ensuring that all users can access them.
If you do this as a user that the program is not working for dependency walker will show you what dependencies are not being found.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With