How to use Selenium Web Driver to test apps developed using electron framework

大城市里の小女人 提交于 2019-12-11 06:13:31

问题


Please refer to these images to get an idea Command Prompt Test Case I am using Selenium web driver with C# for automation using VS2015. One of the apps which I have to test is developed using the electron framework. I have gone through the documentation in the Electron project but I am still struggling to understand how it works. I have written this code to open my electron application, it actually opens the electron window but fails to open the Index.html page in the electron shell.This is my code in C#

ChromeOptions electronOption = new ChromeOptions();
//path to eletron Binary
electronOption.BinaryLocation =
      "C:\\mydev\\electron-quick-start-master\\node_modules\\electron\\dist\\electron.exe";
//Path to the Electron App
electronOption.AddArgument("C:\\mydev\\electron-quick-start-master\\");
DesiredCapabilities capability = new DesiredCapabilities();
capability.SetCapability(CapabilityType.BrowserName, "Chrome");
capability.SetCapability("chromeOptions", electronOption);
DriverContext.Driver = new ChromeDriver(electronOption);  

Can someone please explain me here what //Path to the Electron App means. I have also seen this in the link which I have presented you. If I run the same commands above in command line like below it actually opens the index.html page in the electron shell. The following are the commands for command line

C:\mydev\electron-quick-start-master\node_modules\electron\dist\electron.exe C:\mydev\electron-quick-start-master\

Can someone please help me understand how to work with it. If any one can post me a simple C# code to input into a app containing the textbox using electron framework, it will really help me to understand the flow.

来源:https://stackoverflow.com/questions/40392969/how-to-use-selenium-web-driver-to-test-apps-developed-using-electron-framework

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!