Save Image Version 9 (Java)

Action group: Browsers


Description

The action saves the image from the web page to a file on the local computer and returns the full path to that file.

Action icon

Settings of parameters

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
ContextAction context for working with the browser.Robin.SeleniumBrowser contextYes
ElementWeb element with imageRobin.WebElement
Yes
Folder pathPath to folder to save imageRobin.FolderPathC:\doc\imgYes
Image sourceSource of saved image. There are 3 options available: 1) Resource URL. Saves images by URL. Suitable for images enclosed in an img tag. Not suitable for saving captcha and other types of images. 2) Scripts (JS script is used). Saves image using JS scripts. Suitable for saving any images, including captcha. 3) Screenshot (JS script is used). Cuts an image from a screenshot of a browser window. Allows you to save images that do not go beyond the browser window, including captcha.Robin.String
No
Results
Path to image filePath to image fileRobin.ImageC:\doc\img.png

Special conditions of use

  1. It is assumed that the desired page is already open in the browser.
  2. To avoid conflicts with the uniqueness of image file names, it is suggested to use the generated GUID as the file name.
  3. The preferred format in which the image is saved is PNG. 

Example of use

Task

Follow the link https://bankrot.cdtrf.ru/public/default.aspx and save the image from the web page.


Solution

Use the "Open Browser", "Navigate", "Save Image" actions.

Implementation

  1. Assemble a robot scheme with the actions.

  2. Set the "Open Browser" action parameters.

  3. Set the "Navigate" action parameters.

  4. Set the "Save Image" action parameters. To create an element use the WebSpy tool (see section Create Web-element). 
  5. Click "Start" in the top panel.

Result

The program robot completed successfully.

The image is saved.


  • Нет меток