Sikuli4Net无法找到服务器错误

时间:2017-03-18 09:19:56

标签: c# selenium sikuli

我正在尝试使用Sikuli4Net,但我在行screen.Wait(gmail);中遇到了这个例外:

System.Net.WebException: 
Unable to connect to the remote server
InnerException  {"No connection could be made because the 
target machine actively refused it 127.0.0.1:8080"} System.Exception 
{System.Net.Sockets.SocketException}
"No connection could be made because the target machine actively refused it 
127.0.0.1:8080"

这是我的代码:

IWebDriver driver = new ChromeDriver();
driver.Manage().Window.Maximize();
driver.Navigate().GoToUrl("https://www.google.co.nz/");
Thread.Sleep(2000);
Screen screen = new Screen();
Pattern gmail = new 
Pattern(Path.Combine(AppDomain.CurrentDomain.BaseDirectory + 
@"/images/gmail.PNG"));
screen.Wait(gmail);
screen.Click(gmail, true);

我也试过这段代码:

APILauncher launcher = new APILauncher(true);
launcher.Start(); 

我在行launcher.Start();中再次遇到此异常:

System.ComponentModel.Win32Exception: 
The system cannot find the path specified

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

以管理员身份激活管理员和登录。它将解决这个问题