Linking selenium with electron framework (c#)

2020-02-12 23:31发布

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条回答
我欲成王,谁敢阻挡
2楼-- · 2020-02-13 00:01

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.

查看更多
登录 后发表回答