我正在尝试通过 Katalon-Studio 运行包含 Sikuli 方法的测试。我添加了必要的库,但在尝试执行 Sikuli 命令时仍然出现此错误:
[错误] ResourceLoaderBasic: checkLibsDir: libs 目录不在系统路径上:C:\Users\roinr\git\QA\Drivers\libs
[动作] ResourceLoaderBasic: checkLibsDir: 请稍候!试图将其添加到用户的路径
[信息] runcmd: reg QUERY HKCU
[信息] runcmd: reg QUERY HKEY_CURRENT_USER\Environment /v PATH
[错误] ResourceLoaderBasic:checkLibsDir:注销并再次登录!(由于 libs 文件夹在用户路径中,但未激活)
[错误] 在发生致命错误后终止 SikuliX!对不起,但继续下去是没有意义的!如果您对错误原因或解决方案一无所知,请使用 Debug 级别 3 再次运行。您可以将输出粘贴到问答板上。
这是我的脚本:
import internal.GlobalVariable as GlobalVariable
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.sikuli.script.Key;
import org.sikuli.script.Screen;
//Initializing server
System.setProperty("webdriver.chrome.driver", "C:/selenium/chromedriver.exe");
//Initializing variables
ChromeDriver wd = new ChromeDriver();
WebDriverWait wait = new WebDriverWait(wd,10);
Screen s = new Screen();
wd.manage().window().maximize();
wd.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
System.out.println("*** Login Sikuli ***");
wd.get("https://autoqa-materials-zone.firebaseapp.com/login");
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//div[2]/div/input")));
wd.findElement(By.xpath("//div[2]/div/input")).click();
try { Thread.sleep(1000l); } catch (Exception e) { throw new RuntimeException(e); }
s.paste("<USERNAME>");
try { Thread.sleep(1000l); } catch (Exception e) { throw new RuntimeException(e); }
s.type(Key.TAB);
try { Thread.sleep(800l); } catch (Exception e) { throw new RuntimeException(e); }
s.paste("<PASSWORD>");
try { Thread.sleep(1000l); } catch (Exception e) { throw new RuntimeException(e); }
wd.findElement(By.xpath("//form[@id='form']//paper-button[.='login']")).click();
try { Thread.sleep(5000l); } catch (Exception e) { throw new RuntimeException(e); }
wd.quit();
希望你能帮助我,
谢谢。