Skip to Content

Getting error when creating GUISession

Feb 22, 2017 at 08:12 PM


avatar image
Former Member

I m following this C# code to automate C#
SapROTWr.CSapROTWrapper sapROTWrapper = new SapROTWr.CSapROTWrapper();
object SapGuilRot = sapROTWrapper.GetROTEntry("SAPGUI");
object engine = SapGuilRot.GetType().InvokeMember("GetScriptingEngine", System.Reflection.BindingFlags.InvokeMethod, null, SapGuilRot, null);
GuiApplication GuiApp = (GuiApplication)engine;
GuiConnection connection = (GuiConnection)GuiApp.Connections.ElementAt(0);
GuiSession session = (GuiSession)connection.Children.ElementAt(0);

Initially it was working, but now i am getting error as The enumerator of the collection cannot find en element with the specified index. when i try to initialize to session object.

Using SAPLogOn 730 GUI

please help guide me to resolve it

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers