• Forums
    • Public Forums
      • Community Connect
      • Dynatrace
        • Dynatrace Open Q&A
      • Application Monitoring & UEM
        • AppMon & UEM Open Q&A
      • Network Application Monitoring
        • NAM Open Q&A
        • Enterprise Synthetic Monitoring
      • Synthetic Classic
        • Synthetic Classic Open Q&A
      • BSM Open Q&A
  • Home /
  • Public Forums /
  • Network Application Monitoring /
  • Enterprise Synthetic Monitoring /
avatar image
Question by Nick L. · Oct 12, 2018 at 03:18 PM · scripting active

SAP playback error with Agent Recorder

When attempting to script out a SAP application I am getting the error "VB:Msg:Object variable or With block variable not set." However, if I put a break point at the Set session = SAPWindow ("Application = SAPLOGON.EXE") the recorder stops the script and pops up in front of the window. When I hit the play button for the script to continue it works as expected. What do I need to add in order for it to work without the break?

Comment

People who like this

0 Show 0
10 |2000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
  • Most voted
  • Newest
  • Oldest
avatar image

Answer by Yuriy L. · Oct 12, 2018 at 03:44 PM

@Nick L.

Hi Nick,

Based upon your description, most likely the script executes the command in problem before the SAPWindow object gets created. This is a common synchronization problem: you do not want your script to be ahead of your application. So, I think the cure would be to put a command

WaitForWindow "Application = SAPLOGON.EXE"

in front of the command in problem.

Please post whether or not this helped you to address your problem. If this does not help, please open a support ticket.

Thank you,

Yuriy

Comment

People who like this

0 Show 0 · Share
10 |2000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image

Answer by Nick L. · Oct 12, 2018 at 03:56 PM

It did not help the issue. Below is the script. There is already a wait event above the Set command, though I added the second wait event just to double check.

Sub Main() On Error GoTo ErrorHandler 'Comment/Uncomment these as necessary 'InitAgentDriver Me.Name 'InitAppDriver Me.Name InitChild Me.Name Dim session As Object ' -------------------------------------------------------------------------------------- ' -------------- Launch SAP -------------- 'StartTrace "" ' START vvvvvvvvvvvvv LaunchApp "C:\Program Files (x86)\SAP\FrontEnd\SAPgui\saplogon.exe" WaitForAny "SAP_GUI_Launch" 'Looking for "PROD - ECC" 'StopTimerAndTrace "" ' END ^^^^^^^^^^^^^^^ ' -------------- Launch user session -------------- ShowStatusBox ("Clicking on 'Opening Prod Ecc'...") 'StartTrace "" ' START vvvvvvvvvvvvv Window("Application=SAPLOGON.EXE ClassName='#32770' Caption='SAP Logon 740'").Attach ListView("Parent.Caption=myContainer").Select "DEV - ECC", tpMouseDoubleClick WaitForWindow "Application=SAPLOGON.EXE Caption='SAP Easy Access - User Menu for CVAN02'", DoesExist 'StopTimerAndTrace "" ' END ^^^^^^^^^^^^^^^ ' -------------- Open FB03 -------------- ShowStatusBox ("Opening 'FB03'...") 'StartTrace "" ' START vvvvvvvvvvvvv 'Set session = SAPWindow("Application = SAPLOGON.EXE") WaitForWindow ("Application = SAPLOGON.EXE") Set session = SAPWindow("Application = SAPLOGON.EXE") 'session.Object.findById("wnd[0]").Maximize session.Object.findById("wnd[0]/tbar[0]/okcd").SetFocus session.Object.findById("wnd[0]/tbar[0]/okcd").Text = "fb03" session.Object.findById("wnd[0]/tbar[0]/btn[0]").press

Comment

People who like this

0 Show 0 · Share
10 |2000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image

Answer by Yuriy L. · Oct 12, 2018 at 04:16 PM

Please open a support ticket. It's necessary to do some experiments.

Comment

People who like this

0 Show 0 · Share
10 |2000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 10 attachments (including images) can be used with a maximum of 52.4 MB each and 262.1 MB total.

Welcome to the
Dynatrace Community Forums

Check out the Forum User Guide and Forum Guidelines to learn how to get started.

Community Member of the Month
February 2019

Announcing Dynatrace's Community Member of the Month for February 2019, Larry R.! Click here to read more!

Employee Member of the Month
February 2019

Announcing Dynatrace's Employee Member of the Month for February 2019, Dave M.! Click here to read more!

Live webinar: AIOps done right through enhanced Dynatrace AI root cause detection

Learn the enhanced capabilities of the next generation Dynatrace AI root cause analysis and how to feed it with your own data sources.
Wednesday, February 20, 2019
Register today!

Live webinar: AIOps done right through enhanced Dynatrace AI root cause detection

Learn the enhanced capabilities of the next generation Dynatrace AI root cause analysis and how to feed it with your own data sources.
Wednesday, February 20, 2019
Register today!

NAM 2019 Beta is available

Would you like to have an early taste of what we have cooked up for 2019? We would love to hear your feedback and improve some of the new features. Check NAM 2019 Beta release notes.
Sign up today!

Follow this Question

Answers Answers and Comments

31 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Manually marking a transaction unavailable 2 Answers

Sample usage of Whenever for Proxy Login 1 Answer

Activex under SilverLight 3 Answers

Transactions using CMD 3 Answers

Verification of transaction run times complete... 2 Answers

Forum Tags

nam server scripting recorder nam java cns communication scheduler install esm sizing nam console console string matching 12.5 database xendesktop agent manager active ocr citrix dna vba rum migration files configuration license framework security sap agent documentation alerting css autocheck
  • Forums
  • Public Forums
    • Community Connect
    • Dynatrace
      • Dynatrace Open Q&A
    • Application Monitoring & UEM
      • AppMon & UEM Open Q&A
    • Network Application Monitoring
      • NAM Open Q&A
      • Enterprise Synthetic Monitoring
    • Synthetic Classic
      • Synthetic Classic Open Q&A
    • BSM Open Q&A