2017-03-18 137 views
0

我想使用Sikuli4Net但我行screen.Wait(gmail);得到這個異常:Sikuli4Net無法找到服務器錯誤

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 

我該如何解決這個問題?

回答

0

激活管理員並以管理員身份登錄。它會解決這個問題

相關問題