Thursday, 23 April 2020

I'm using vision to click but nothing happens?

Q: I'm using vision to click but nothing happens?

A: You may have encountered an error. The error message will not  appear while Tagui is running. Instead, it will show in the tagui.log file in the tagui.sikuli folder. Stop the program and open the file instead. Also, ensure you have Java 64 installed. Sikuli does not work with 32-bit Java.


Recording actions in Chrome

Q: How do I record my actions in Chrome?

A: Please follow the steps below


  1. Add Extension TagUI Web Automation to Chrome
  2. To start recording, click the TagUI icon and click START
  3. Perform the actions you need to record
  4. Once done, click the TagUI icon again and click STOP
  5. Then click EXPORT
Note that the recording is not perfect. The script will still need to be manually edited. 







Running TagUI Live

Q: How do I run TagUI live, not in the background (headless)?

A: add "chrome" after the script


Tuesday, 17 March 2020

WFH Tip#1 Dual Monitor

If you are used to working on a bigger screen at the office and you have an extra monitor at home, you can connect your monitor to your laptop and you can work with two screens. You may  use one screen for messenger, and the other for SAP. For me this is very helpful and as it happens it's also very simple to do. Just follow the steps below.
  1. Connect monitor to your laptop
  2. Right-click on the blank space of your desktop wallpaper
  3. Click Display settings
  4. Scroll down and to go Multiple displays
  5. select Extend these displays
  6. A dialogue box will appear, "Keep these display settings?"
  7. Select Keep changes
  8. If you need to switch the location of your extended monitor, say from the left of your laptop to the right, scroll up and look for "1" and "2" boxes. Switch them by dragging the monitor/box. 
  9. Click Apply
  10. Close by clicking the "x" at the right of the screen. 









Tuesday, 23 April 2019

Automating Period Closing in Test Environment using Excel and VBScript

Q:  Is there a way to automate the closing in MMPV? Say the current posting period in the test environment for the company code you need to test is in 2011 and it's now 2019.


A: Check out the article by Mariano Cabalen. After I did the recording and made a few adjustments to his code, it ran perfectly.

Warning: If you want to use this code ensure have only the SAP Test Environment open, and only the Excel sheet you need to use open. The program looks at the active Worksheet.
  1. Login to SAP Test Environment
  2. Format your Excel similar to mine, screenshot below.
  3. Copy and paste my code to notepad and change the extension to VBS. 
  4. Double click the file
  5. A dialog box will appear with the message "A script is trying to attach to the GUI". 
  6. Click Ok. The script will then run. Sit back and watch a ghost use your computer and do you work☺



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

Dim objExcel
Dim objSheet, intRow, i
Set objExcel = GetObject(,"Excel.Application")
Set objSheet = objExcel.ActiveWorkbook.ActiveSheet
For i = 2 to objSheet.UsedRange.Rows.Count
columnA = Trim(CStr(objSheet.Cells(i, 1).Value))
columnB = Trim(CStr(objSheet.Cells(i, 2).Value))
columnC = Trim(CStr(objSheet.Cells(i, 3).Value))
columnD = Trim(CStr(objSheet.Cells(i, 4).Value))

session.findById("wnd[0]/tbar[0]/okcd").text = "/n mmpv"
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/usr/ctxtI_VBUKR").text = columnA
session.findById("wnd[0]/usr/ctxtI_BBUKR").text = columnB
session.findById("wnd[0]/usr/txtI_LFMON").text = columnC
session.findById("wnd[0]/usr/txtI_LFGJA").text = columnD
session.findById("wnd[0]/usr/txtI_LFGJA").setFocus
session.findById("wnd[0]/usr/txtI_LFGJA").caretPosition = 4
session.findById("wnd[0]/tbar[1]/btn[8]").press
session.findById("wnd[0]").sendVKey 0
Next