on 05-21-2009 6:26 PM
We have an application that emulate the user interaction with SAP application and use SAP GUI scripting (GUI for window) from VB module to interact with SAP application and perform various operations on SAP window. The operation performed during that exercise are inputting values, search a node in tree, search a value in table, input value in a table cell, click on button, send virtual keys to sap window, interacting with context menu etc etc.. Operations that need to perform on SAP GUI are organized into 'tests" and are performed in a serial fashion. A same test (sequence of operations) can be performed any number of times on a given SAP application.
Lately, we have seen that either SAP Gui crashes or become unresponsive at random when a set of operations (test) are being performed iteratively on SAP GUI. The same test executed correctly many times but at random iteration it become completely unresponsive and hung up.
Although, SAP Gui hang up occurred at a random iteration but we've noticed that if there were two sap instances on the machine then this behavior is noticed much earlier and it is almost certain to get to this sate if an ECATT is running in another sap window but still not able to establish a particular pattern and some time same tests were executed correctly in all the above mentioned scenarios. However, when problem occurred, it usually happen just after the operations that have caused SAP GUI to do a server round trip like click on button or scrolling a table etc but still it was quite random and was unable to establish a pattern.
When SAP GUI hung up then not only it becomes completely unresponsive, but it also hung up any application they tries to interact with SAP GUI scripting object. At this point, any attempt to make any references to any scripting object or even a fresh attempt to connect to scripting object model also hung up that application. The only way out at that point is to kill SAP Gui from the task manager and once SAP Gui killed then all application that was previously hang up start to resume execution!
SAP GUI for Window 7.1 patch 7 and path 11 are being used.
Any help shall be greatly appreciated.
Hello from Germany,
If I have understood correctly, is about the problem that a recorded VB script only in the first mode can run. This problem I have with me solved as follows:
For example:
Original script:
If Not IsObject(application) Then
Set SapGuiAuto = GetObject("SAPGUI")
Set application = SapGuiAuto.GetScriptingEngine
End If
If Not IsObject(connection) Then
Set connection = application.Children(0)
End If
If Not IsObject(session) Then
Set session = connection.Children(0)
End If
If IsObject(WScript) Then
WScript.ConnectObject session, "on"
WScript.ConnectObject application, "on"
End If
session.findById("wnd[0]").maximize
session.findById("wnd[0]/usr/subSUBSCREEN...
session.findById("wnd[0]/usr/subSUBSCREEN...
New script:
If Not IsObject(application) Then
Set SapGuiAuto = GetObject("SAPGUI")
Set application = SapGuiAuto.GetScriptingEngine
End If
If Not IsObject(connection) Then
Set connection = application.Children(0)
End If
If Not IsObject(session) Then
Set session = connection.Children(0)
End If
If IsObject(WScript) Then
WScript.ConnectObject session, "on"
WScript.ConnectObject application, "on"
End If
err.clear
on error resume next
SESSION_ = 0
do
err.clear
session.findById("wnd[0]").maximize
session.findById("wnd [0]/usr/subSUBSCREEN...
if err.number = 0 or SESSION_ = 5 then exit do
SESSION_ = SESSION_ + 1
Set session = connection.Children(int(SESSION_))
loop
on error goto 0
session.findById("wnd[0]/usr/subSUBSCREEN...
There is no general solution. It is the only way to suggest how it could solve some.
Sorry for my English. I must admit, I can absolutely not.
Regards
ScriptMan
Edited by: ScriptMan on May 22, 2009 3:01 PM
Edited by: ScriptMan on May 22, 2009 3:06 PM
Edited by: ScriptMan on May 25, 2009 11:06 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.