I am automating tests of our SAP GUI application using Silk4J (16.0.1.7470). There is a tree where I selected a node. I can open the context menu programmatically with SapTree.nodeContextMenu().
Now I want to simulate a click onto one of the context menu items. It seems that this can be done with SapTree.selectContextMenuItem(). However, this function needs a function code.
How do I get a list of function codes that are available on the context menu?
I have tried SapTree.selectContextMenuItemByText() but that resulted in the exception.
java.lang.RuntimeException: Error executing 'SelectContextMenuItemByText'. An unexpected COM exception occurred at SAP Frontend Server (The method got an invalid argument.) at com.borland.silktest.jtf.internal.Agent.convertException(Agent.java:294) at com.borland.silktest.jtf.internal.Agent.invoke(Agent.java:394) at com.borland.silktest.jtf.AbstractTestObject.invoke(AbstractTestObject.java:462) at com.microfocus.silktest.jtf.sap.SapTree.selectContextMenuItemByText(SapTree.java:1650) ...
I have also tried SapContextMenu.select(), but there is no parameter to that method, so I wonder which item it will select.