如何比较图像并做出断言?

时间:2015-01-13 12:35:41

标签: java selendroid

1.首先我将上传一个.png文件。然后动态地,我想检查特定图像是否已上传。

2.我正在将图片从一个网址上传到另一个网站的网页。我不知道如何比较这两个图片并检查特定图片是否已上传。

3.我不知道如何渲染已上传的图像,因为它在上传方法时会生成id

4.如何获取图像相关信息以进行断言以确保上传的图像。

5.如何在不将图像路径存储在本地的情况下比较两个图像。

我上传的代码就像这样

URL aRemoteUrl = new URL("http://tester/pipeline/logo/logo.png");
            File temp = File.createTempFile("temp-file-name", ".png");
FileUtils.copyURLToFile(aRemoteUrl, temp);
            System.out.println("Temp file : " + temp.getAbsolutePath());
            upload.sendKeys(temp.getAbsolutePath());
Here,I have tried with below coding to render the image that has been uploaded,Initally i got current url ,where i have uploaded my .png file.But after that i don't know to how to get the image related attributes
   //Check if Image has been uploaded
            driver.getCurrentUrl();
            System.out.println("hhh"+driver.getCurrentUrl());
            List<WebElement> elements = driver.findElements(By.cssSelector("*"));

0 个答案:

没有答案