01-05-2024 11:58 AM
Hello everyone!
I'm very new to sapgui and have been struggling to select a GuiTab in MM03 transaction. Selection works completely fine with a vbs script but the Python equivalent code doesn't work.
Sapgui version: 800 Final Release - 32bit
Python version: 3.10.9 64-bit
Here is a screenshot of the tabs I would like to select:
Here is the Python code that should select a tab:
This method receives the following arguments:tabstrip locator and a text of a tab that should be selected. This method is run by Robot Framewort in a for loop. All the arguments are correct.
I have tried to select the tab with both selecting it with locator and object itself but nothing get's selected. There isn't any error message. I also tried to get the tab object from tabs with ElementAt which worked fine but didn't change anything.
All the arguments / locators printed by this method and Robot Framework are correct and have been checked with Scripting Tracker.
Vbs script made by recording works without any problems:
I also attempted to copy this script to Python like so:
This also didn't select anything or generate an error.
Any suggestion are welcome, and I thank anyone beforehand for their time in helping me.
02-29-2024 9:32 AM
I would suggest to use RoboSAPiens, a Python library that allows to automate the SAP GUI using the text you see on the screen. With it you can select a tab using its name.
If I am not mistaken, your SAP GUI is in Finnish. You might consider using Robot Framework, an open-source Python-based keyword-driven test automation framework from Finnland, which allows writing automation scripts in any human language. RoboSAPiens is actually meant to be used from Robot Framework. Currently keywords are only available in English and German, but other translations are welcome.
Disclaimer: I am the author of RoboSAPiens and have extensive experience automating the SAP GUI using the Scripting API.