使用sikuli测试web网页实例

1、将图片截图放置项目的目录下
在这里插入图片描述
2、项目代码:

    public static void main(String[] args) throws FindFailed, InterruptedException {
        Screen screen = new Screen();
        String imgPath = "E:\\workspace\\study\\ImageIdentifyAutoTest\\image\\web";
        screen.doubleClick(imgPath + "\\tubiao.png");
        screen.click(imgPath + "\\baidu.png");
        Thread.sleep(2000);
        screen.paste(imgPath + "\\sousuotiao1.png", "sikuli");
        screen.click(imgPath + "\\select1.png");
        System.out.println("成功!");
    }

3、运行程序。注意:需要在首界面显示能够查询到tubiao.png,运行结果如下视频所示:
在这里插入图片描述

发布了14 篇原创文章 · 获赞 3 · 访问量 304

猜你喜欢

转载自blog.csdn.net/xiaomin1328/article/details/105195711