Set Grid Value

Verb: setGridValue

Sets a value to a cell in a control grid, according to the defined mappings.

Controls are, in the context of Windows, elements that allow the user to interact with an application. Controls can be buttons, data entry fields, menus and various other elements.

Syntax

setGridValue --value(String) --grid(ImageGrid) --row(Numeric) --column(Numeric)

Inputs

Script Designer Required AcceptedTypes Description
--value Value Required Text Value that should be set to the cell.
--grid Grid Required Image Grid Grid containing the cell to which the value should be set.
--row Row Required Number Cell row to which the value should be set.
--column Column Required Number Column of the cell to which the value should be set.

Example

The Wait for Window to Appear command waits for an open Excel window, the Focus Window command focuses on the window, the Map Image Grid command maps the Grid in the window and the Set Grid Value command assigns the values ​​"Microsoft" and "Redmond" in the first two cells of the fifth row of the table.

defVar --name excelWindow --type Window
defVar --name excelTable --type ImageGrid
defVar --name excelRows --type Numeric
defVar --name excelColumns --type Numeric
// tableExcelCompanyCity.xlsx.
waitWindow --title "tableExcelCompanyCity.xlsx - Excel" --classname XLMAIN --processname EXCEL excelWindow=value
focusWindow --window ${excelWindow}
mapGrid --columnmappings "26-141;141-281;281-386;386-451;451-515;515-578;578-643;643-707;707-771;771-836;836-898;898-964;964-1028;" --selector "XPath" --xpath "/root/pane[1]/pane[1]/pane[1]/datagrid[1]" excelTable=value excelColumns=rows excelRows=columns
setGridValue --value Microsoft --grid ${excelTable} --row 5 --column 1
setGridValue --value Redmond --grid ${excelTable} --row 5 --column 2
// An Excel window is awaited and focused, a window is mapped inside that window and the values ​​are assigned to it.

Download File

For this example to run successfully, it is necessary to download the Excel file and open it before execution.

See Also

  • Attach Window
  • Cancel Token Source
  • Clear Cache
  • Click
  • Click on Cell
  • Click on Menu
  • Click on Value
  • Close Window
  • Control Screenshot
  • Count Windows
  • Expand Tree
  • Find Window
  • Find Windows
  • Focus
  • Focus Window
  • Get Barcode
  • Get Bounds
  • Get Cell Value
  • Get Control
  • Get Image Grid
  • Get Interval
  • Get Options
  • Get Table
  • Get Table Information
  • Get Tree Nodes
  • Get Value
  • Handle Open File Dialog
  • Handle Save File Dialog
  • Launch and Attach Window
  • Launch or Attach Window
  • Launch SAP Application
  • Map Image Grid
  • Maximize or Minimize Window
  • Offset Value
  • SAP Transaction
  • Screenshot Window
  • Select Row
  • Select Tab
  • Set Execution Throttling
  • Set Value
  • Update Window
  • Verify Enabled
  • Verify If Visible
  • Wait and Close Security Window
  • Wait Busy Window
  • Wait Control
  • Wait for Control to Enable
  • Wait for Window to Appear
  • Watch and Close Window
  • Watch and Select Client Certificate
  • Watch and Set Credentials in Browser