2gis / Winium.Desktop

Winium.Desktop is Selenium Remote WebDriver implementation for automated testing of Windows application based on WinFroms and WPF platforms.
Mozilla Public License 2.0
402 stars 140 forks source link

Windows 10 pro: Message: OpenQA.Selenium.WebDriverException : Access is denied #294

Open michelleXIE2014 opened 5 years ago

michelleXIE2014 commented 5 years ago

I am using c# and nunit, ` [Test] public void installDCA() { var dc = new DesiredCapabilities(); dc.SetCapability("app", @"C:/download/new_installer.exe"); var driver = new RemoteWebDriver(new Uri("http://localhost:9999"), dc);

        var window = driver.FindElementByClassName("TWizardForm");
        var nextButtonOnScreen1= window.FindElement(By.ClassName("TNewButton"));

        nextButtonOnScreen1.Click();
       driver.Close();
    } 

` On the command: I ran "Winium.Desktop.Driver.exe --verbose"

From my vistual studio console: ` Test Outcome: Failed Test Duration: 0:00:06.95

Result StackTrace:
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary2 parameters) at OpenQA.Selenium.Remote.RemoteWebElement.Click() at Tests.Tests.installDCA() in C:\ NUnitTestProject1\UnitTest1.cs:line 92 Result Message: OpenQA.Selenium.WebDriverException : Access is denied from the command window 15:10:09 [DEBUG] RESPONSE: OK: { "sessionId": "AwesomeSession", "status": 13, "value": { "error": "unknown error", "stacktrace": " at MS.Internal.Automation.Misc.ThrowWin32ExceptionsIfError(Int32 errorCode)\r\n at MS.Internal.Automation.Misc.EvaluateSendMessageTimeoutError(Int32 error)\r\n at MS.Internal.Automation.Misc.SendMessageTimeout(HWND hwnd, Int32 Msg, IntPtr wParam, IntPtr lParam)\r\n at MS.Internal.Automation.HwndProxyElementProvider.ChildWindowFromPoint(HWND hwnd, Double x, Double y, Boolean& isClientArea)\r\n at MS.Internal.Automation.HwndProxyElementProvider.ElementProviderFromPoint(HWND current, Double x, Double y)\r\n at MS.Internal.Automation.HwndProxyElementProvider.System.Windows.Automation.Provider.IRawElementProviderFragmentRoot.ElementProviderFromPoint(Double x, Double y)\r\n at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)\r\n at MS.Internal.Automation.UiaCoreApi.CheckError(Int32 hr)\r\n at MS.Internal.Automation.UiaCoreApi.UiaNodeFromPoint(Double x, Double y, UiaCacheRequest request)\r\n at System.Windows.Automation.ClickablePoint.TryPoint(Point& pt, AutomationElement el, AutomationElement& hitEl)\r\n at System.Windows.Automation.ClickablePoint.HitTestForClickablePoint(AutomationElement el, Point& pt)\r\n at System.Windows.Automation.AutomationElement.TryGetClickablePoint(Point& pt)\r\n at Winium.Cruciatus.Core.CruciatusElementProperties.get_ClickablePoint()\r\n at Winium.Cruciatus.CruciatusCommand.TryClickOnClickablePoint(MouseButton button, CruciatusElement element, Boolean doubleClick)\r\n at Winium.Cruciatus.Elements.CruciatusElement.Click(MouseButton button, ClickStrategies strategy, Boolean doubleClick)\r\n at Winium.Cruciatus.Elements.CruciatusElement.Click()\r\n at Winium.Desktop.Driver.CommandExecutors.ClickElementExecutor.DoImpl()\r\n at Winium.Desktop.Driver.CommandExecutors.CommandExecutorBase.Do()", "message": "Access is denied" } }

Thank you, do you have any clue about this issue?

GitSayali commented 5 years ago

Launch the command prompt with administrator rights and run the command.