我已经使用 Selenium webdriver 在 C# 中编写了几行代码.随着我的应用程序转移到 Electron 框架,一切都发生了变化,老实说,我现在不知道如何应对.
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.
你能帮我澄清一下吗?我应该采取什么步骤来简单开始...我想继续我在当前项目中的工作(硒,C#),但我不确定这是否可能,或者我应该完全从头开始使用不同的语言和框架?
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?
我已经阅读了有关 Spectron 的信息,并检查了诸如 stackoverflow 之类的互联网资源,但是我仍然处于不知情的地步……
I've read about Spectron, and checked the internet resources like stackoverflow, however I'm still in the point of unawareness...
带有 mocha 的 Spectron 应该更快.
Spectron with mocha is supposed to be faster.
但这里仍然是您需要的.这是 Java &硒.
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);
我已将打包的电子应用程序用于二进制(即) app.exe .
I have used the packaged electron app for binary (i.e) app.exe .
我认为这就是你所需要的.
I think this is what you need.
这篇关于将硒与电子框架联系起来(c#)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!