【发布时间】:2014-06-23 17:33:47
【问题描述】:
我已在构建路径中添加了所有必需的 jar,但是当执行到达 Sikuli API 时出现此错误
[error] ResourceLoaderBasic: checkLibsDir: libs dir is not on system path: C:\Users\general\Desktop\Sikuli\libs
[action] ResourceLoaderBasic: checkLibsDir: Please wait! Trying to add it to user's path
[info] runcmd: reg QUERY HKCU
[info] runcmd: reg QUERY HKEY_CURRENT_USER\Environment /v PATH
[error] ResourceLoaderBasic: checkLibsDir: Logout and Login again! (Since libs folder is in user's path, but not activated)
[error] Terminating SikuliX after a fatal error!
对不起,继续没有意义! 如果您对错误原因或解决方案没有任何想法,请再次运行 调试级别为 3。您可以将输出粘贴到问答板上。
这是我的代码
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.sikuli.script.App;
import org.sikuli.script.FindFailed;
import org.sikuli.script.Pattern;
import org.sikuli.script.Screen;
public class Sikuli_test3 {
@Test
public void functionName() throws FindFailed {
// Create a new instance of the Firefox driver
WebDriver driver = new FirefoxDriver();
// And now use this to visit Google
driver.get("http://www.google.co.in");
//WebElement element = driver.findElement( By.id("gbqfq"));
//element.sendKeys("Hello");
//element.click();
//Create and initialize an instance of Screen object
Screen screen = new Screen();
//Add image path
Pattern image = new Pattern("C:\\sikuli_images\\iam_feeling_lucky.png");
//Wait 10ms for image
screen.wait(image, 10);
//Click on the image
screen.click(image);
}
}
【问题讨论】: