0

I have recorded a script on SAP that runs on CITRIX. Everything worked fine until some items were added to the window that the right item was selected to filter the columns. I guess the reason is that the proper item (e.g. MATART in the shown picture) moved down and it was not the same row, order etc.

I was wondering whether there is a way to select the item by its name instead of id?

enter image description here

This is the part of the script with the line which selects the items:

session.findById("wnd[0]/tbar[0]/okcd").text = "/nzm082"
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/tbar[1]/btn[8]").press
session.findById("wnd[0]/tbar[1]/btn[33]").press
session.findById("wnd[1]/usr/cntlGRID/shellcont/shell").currentCellRow = 1
session.findById("wnd[1]/usr/cntlGRID/shellcont/shell").selectedRows = "1"
session.findById("wnd[1]/usr/cntlGRID/shellcont/shell").clickCurrentCell
session.findById("wnd[0]/tbar[1]/btn[45]").press
Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Ibo
  • 4,081
  • 6
  • 45
  • 65

1 Answers1

0

You could test the following.

for example:

...
session.findById("wnd[0]/tbar[1]/btn[33]").press
set myLayout = session.findById("wnd[1]/usr/cntlGRID/shellcont/shell")

Rows = myLayout.RowCount
For i = 0 to Rows - 1 
myVariant = session.findById("wnd[1]/usr/cntlGRID/shellcont/shell").getCellValue (i, "VARIANT")
if myVariant = "MTART" then
   session.findById("wnd[1]/usr/cntlGRID/shellcont/shell").currentCellRow = i
   session.findById("wnd[1]/usr/cntlGRID/shellcont/shell").clickCurrentCell
   Exit For
end if
next
session.findById("wnd[0]/tbar[1]/btn[45]").press
...

Regards, ScriptMan

ScriptMan
  • 1,580
  • 1
  • 9
  • 9