Linking selenium with electron framework (c#)

流过昼夜 提交于 2019-11-28 05:06:42

问题


I've already written few lines of code in C# using Selenium webdriver. As my application was transferred to the Electron framework everything has changed and honestly, I don't know how to cope with it right now.

Could you please clarify it to me? What steps should I take to simple start... I would like to continue my work in the current project (selenium, C#), but I'm not sure that it's possible, or I should completely start from scratch using a different language and framework?

I've read about Spectron, and checked the internet resources like stackoverflow, however I'm still in the point of unawareness...


回答1:


Spectron with mocha is supposed to be faster.

But still here is what you need.This is Java & Selenium.

System.setProperty("webdriver.chrome.driver","C:\\electron-chromedriver\\bin\\chromedriver.exe");
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.setBinary("C:\\Users\\app.exe");
chromeOptions.addArguments("start-maximized");
DesiredCapabilities capability = new DesiredCapabilities();
capability.setCapability(CapabilityType.BROWSER_NAME, "Chrome");
capability.setCapability("chromeOptions", chromeOptions);       
driver = new ChromeDriver(chromeOptions);  

I have used the packaged electron app for binary (i.e) app.exe .

I think this is what you need.



来源:https://stackoverflow.com/questions/51136304/linking-selenium-with-electron-framework-c

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