Testing app developed using Electron framework using Selenium,C# on VS2015


#1

Hi Guys,
I am new to Selenium and also the Electron framework. My knowledge is limited in this domain. All I want is to start a simple electron based app using C# and Selenium on VS2015 using a simple code and also all the required setups (if applicable) After doing a bit of research I have written this code which successfully starts my sample electron app(which I have downloaded from the internet a - simple Hello world page)

 [TestMethod]
        public void TestElectron()
        {            
            ChromeOptions chromeOptions = new ChromeOptions();
            chromeOptions.BinaryLocation = "C:\\mydev\\electron-quick-start-master\\node_modules\\electron\\dist\\electron.exe";            
            chromeOptions.AddArgument(" C:\\mydev\\electron-quick-start-master");
            DesiredCapabilities capability = new DesiredCapabilities();
            capability.SetCapability(CapabilityType.BrowserName,"Chrome");
            capability.SetCapability("chromeOptions", chromeOptions);
            IWebDriver driver = new ChromeDriver(chromeOptions);
            
        }

This code does what I want but I get the following exception and the test terminates with an error :

Test Name:	TestElectron
Test FullName:	LightHouseTestCases.UnitTest1.TestElectron
Test Source:	C:\Automation\ProjectLighthouseDemo\LightHouseTestCases\UnitTest1.cs : line 133
Test Outcome:	Failed
Test Duration:	0:01:01.443151

Result StackTrace:	
at System.Net.HttpWebRequest.GetResponse()
   at OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest request)
 --- End of inner exception stack trace ---
    at OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest request)
   at OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(Command commandToExecute)
   at OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute(Command commandToExecute)
   at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
   at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
   at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeOptions options)
   at LightHouseTestCases.UnitTest1.TestElectron() in C:\Automation\ProjectLighthouseDemo\LightHouseTestCases\UnitTest1.cs:line 140
Result Message:	
Test method LightHouseTestCases.UnitTest1.TestElectron threw exception: 
OpenQA.Selenium.WebDriverException: The HTTP request to the remote WebDriver server for URL http://localhost:63590/session timed out after 60 seconds. ---> System.Net.WebException: The operation has timed out

Can anyone please help me with fixing this issue.Thanks in advance.


#2

Please visit here, you can get answer to your query.