/
Get Element Collection

Get Element Collection

Use this page to find example workflows for Genta Automation.


Introduction

This function can be used to capture multiple elements (i.e., a list of names) in a web application.

Step-by-Step Guide

Move the mouse around to select the active element associated with the image.

  1. Hold down CTRL and click the icon selected.

2. After selecting the first item, the Get Element Collection message box will be displayed.

 

3. Hold down CTRL and click the second selected icon.

 

4. In the following window, the attribute of elements to capture and the variable name to store the collection as String Array can be entered.

 

5. After clicking Copy to Clipboard, the expression comes as:

$MyArray = @GetElementCollection("/html/body/header/div/nav[1]/div/ul/li[3]/ul/li[1]/a", "/html/body/header/div/nav[1]/div/ul/li[3]/ul/li[2]/a", "Text")

Script

$website = "https://www.iwmf.org/" Navigate to $website -maximize Hover Mouse over "Programs" $MyArray = @GetElementCollection("/html/body/header/div/nav[1]/div/ul/li[3]/ul/li[1]/a", "/html/body/header/div/nav[1]/div/ul/li[3]/ul/li[2]/a", "Text") Foreach($row in $MyArray) { Show Message Box $row }

Video


Related Articles

Related content