硒与电子骨架的连接(C#) [英] Linking selenium with electron framework (c#)

查看:98
本文介绍了硒与电子骨架的连接(C#)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用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.

您能告诉我一下吗?我应该采取什么步骤来简单地开始...我想在当前项目(Selenium,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之类的Internet资源,但是我仍然不了解...

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#)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆