初级使用者 2020-03-30 16:06
浏览 210

selenium与sikuli结合

多个Test:在使用selenium测试一个登陆界面(longinTest)后,使用sikuli查找主页面中的截图并点击该按钮(BiduiRenwuTest),总是提示找不到图片"(FindFailed--E:\workspace\study\ImageIdentifyAutoTest\image\Face\shouye\1585552676831.png")。(两个Test是按照先后顺序执行的)
解决方案:将BiduiRenwuTest中的代码合并到第一个Test执行,就没有错误了,求助,为什么???

@Test
    public void loginTest() throws InterruptedException, FindFailed {
        driver.get(baseUrl + "/");
        driver.findElement(By.xpath("//*[@id=\"app\"]/div/div[1]/div/ul/li[1]/input")).sendKeys("sa");
        driver.findElement(By.xpath("//*[@id=\"app\"]/div/div[1]/div/ul/li[2]/input")).sendKeys("1");
        driver.findElement(By.xpath("//*[@id=\"app\"]/div/div[1]/div/ul/li[3]/input")).click();
        Thread.sleep(3000);
    }

   @Test
    public void BiduiRenwuTest() throws FindFailed {
        //保证页面在前端
        Screen screen = new Screen();
        Pattern biduirenwu = new Pattern("E:\\workspace\\study\\ImageIdentifyAutoTest\\image\\Face\\shouye\\1585552676831.png");
        screen.wait(biduirenwu,5);
        screen.click(biduirenwu);
        System.out.println("insert biduirenwu ok!");
    }

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 链接问题 C++LNK2001 无法解析的外部符号
    • ¥50 安装pyaudiokits失败
    • ¥15 计组这些题应该咋做呀
    • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
    • ¥15 让node服务器有自动加载文件的功能
    • ¥15 jmeter脚本回放有的是对的有的是错的
    • ¥15 r语言蛋白组学相关问题
    • ¥15 Python时间序列如何拟合疏系数模型
    • ¥15 求学软件的前人们指明方向🥺
    • ¥50 如何增强飞上天的树莓派的热点信号强度,以使得笔记本可以在地面实现远程桌面连接