Testing Images

Classic Agent

If you are using the Classic Agent, images in your Web application are objects of type HtmlImage. You can verify the appearance of the image by using the Bitmap tab in the Verify Window dialog box.

If an HtmlImage is an image map, which means that the image contains clickable regions, you can use the following methods to test the clickable regions:
  • GetRegionList
  • MoveToRegion
  • ClickRegion

Open Agent

If you are using the Open Agent, you can test images by using the IMG locator. For example, the following code sample finds an image and then prints some of the properties of the image:
Window img = FindBrowserApplication("/BrowserApplication").FindBrowserWindow("//BrowserWindow").Find("//IMG[@title='Image1.png']")
String src = img.GetProperty("src")
String altText = img.GetProperty("alt")
print(src)
print(altText)