就像在 java 中一样,我们有以下代码。我在 c# 中需要相同的代码。
启动 winium 驱动程序
public WiniumDriver setupEnvironment() throws IOException {
String outlookApplicationPath = "C:\\ProgramfileS|\...\..\outlook.exe";
String winiumDriverPath = "C:\Progra...\..\winium.desktop.exe";
options = new DesktopOptions(); //Initiate Winium Desktop Options
options.setApplicationPath(outlookApplicationPath); //Set outlook application path
File drivePath = new File(winiumDriverPath); //Set winium driver path
service = new WiniumDriverService.Builder().usingDriverExecutable(drivePath).usingPort(9999).withVerbose(true).withSilent(false).buildDesktopService();
service.start(); //Build and Start a Winium Driver service
driver = new WiniumDriver(service, options); //Start a winium driver
return driver;
}