on 01-07-2014 9:43 AM
Hi SAP Experts,
I have a activity to do performance test with 100 concurrent users.
But unfortunately i have no supplement PT software for this activity (Like Rational PT or Loadrunner).
So i think i will do it with sapgui script.
Is it possible to create vb script (SAP GUI Scripting) to fulfill my requirement to do this activity. If yes how to create this script.
Thanks & Best Regards,
Husin
Dear All,
The problem is solved now,
i just pass the parameter value of user id to the script and run the script simultaneously.
Thanks & best regards,
Husin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Husin,
Using Excel VBA:
Populate the usernames and respective password in a worksheet with codename "Sheet1" (default for the 1st worksheet on a new Workbook) without header. Example:
Perform early binding to the SAP GUI Scripting API:
Open the VBA Editor. Tools > Reference... > Browse... > Locate sapfewse.ocx (usually in folder C:\Program Files\SAP\FrontEnd\Sapgui).
Insert a standard VBA module and put the following codes (change the parameters according to your requirement accordingly):
'//--- start of codes
Option Explicit
Sub LoginConcurrent()
Dim sapgui As SAPFEWSELib.GuiApplication
Dim sapcon As SAPFEWSELib.GuiConnection
Dim sapsession As SAPFEWSELib.GuiSession
Dim i As Long
Dim totalId As Long
Dim sapID
Dim sapPassword
Set sapgui = GetObject("sapgui").GetScriptingEngine
totalId = Sheet1.Range("A1").End(xlDown).Row
For i = 1 To totalId
Set sapcon = sapgui.OpenConnectionByConnectionString("your.sap.server.address", True)
Set sapsession = sapcon.Children(0)
sapID = Sheet1.Cells(i, 1)
sapPassword = Sheet1.Cells(i, 2)
With sapsession
.FindById("wnd[0]/usr/txtRSYST-MANDT").Text = "200"
.FindById("wnd[0]/usr/txtRSYST-BNAME").Text = sapID
.FindById("wnd[0]/usr/pwdRSYST-BCODE").Text = sapPassword
.FindById("wnd[0]/usr/txtRSYST-LANGU").Text = "EN"
.FindById("wnd[0]").SendVKey 0
.StartTransaction "IW33" '//transaction to test
'//---other codes to test here----//
End With
Next i
Set sapsession = Nothing
Set sapcon = Nothing
Set sapgui = Nothing
End Sub
'//--- end of codes
Thanks,
Sayuti
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sayuti,
I have tried your code, and the result is user ids login sequencially not concurrently.
i think we cannot use looping for this case, we need use thread to make user login dan concurrently.
but unfortunately there is no thread in standard excel vba.
Is there any clue for make this happened?
Thanks & Best Regards,
Husin
Dear Husin,
I'm not sure whether that is possible... perhaps you can refer this discussion: http://scn.sap.com/thread/3467700
Thanks,
Sayuti
Hi Sayuti,
I can run the script concurrently, but i found the other problem there.
I'm using c# to call vbs script (macro) in excel concurrently using backgroundworker component. I can call it concurrently until display logon form in sap gui. but the new problem is when entering below part, the script was executed sequencely per user.
With sapsession
.FindById("wnd[0]/usr/txtRSYST-MANDT").Text = "200"
.FindById("wnd[0]/usr/txtRSYST-BNAME").Text = sapID
.FindById("wnd[0]/usr/pwdRSYST-BCODE").Text = sapPassword
.FindById("wnd[0]/usr/txtRSYST-LANGU").Text = "EN"
.FindById("wnd[0]").SendVKey 0
.StartTransaction "IW33" '//transaction to test
-=== guiscript code ===-
End With
So my assumption is with sapsession ... end with cannot be executed concurrently. there is something behavior that make sapsession scope is not concurrently.
Is there anyone experienced with this?
Please give suggestion on this.
Thanks & Regards,
Husin
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.