cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Robosapiens and SAPGUI Library in Robot Framework: AttributeError:

AutomationTester
Explorer
2,505
  1. @stef_stef Hi, I am using Robosapiens and SAPGUI Library in Robot Framework. I am trying to enter a value in the textfield using the following syntax Input Text wnd[0]/usr/sub/1/txt[1] username
    but getting the error AttributeError: ‘int’ object has no attribute ‘findById’.  I dont have any Label nearer to the TextField. I have used Scripting Tracker to identify the Id of the text field. Please assist

Accepted Solutions (0)

Answers (1)

Answers (1)

Stefan-Schnell
Active Contributor

Hello @AutomationTester,

it seems that the network settings of your connection are set to low speed connection. if you use the Low Speed Connection, problems can occur in SAP GUI Scripting, because the field names are not available in full, only as number in brackets. Set the network settings to High Speed Connection and it should work.

stefan_schnell_0-1717569998227.png

Best regards
Stefan

AutomationTester
Explorer
0 Likes

Hi @Stefan-Schnell , Thanks and Appreciate your response. After changing the network speed to High Speed Connection, I scanned the Element id and used the

*** Variables ***

 

*** Test Cases ***
Enter SAP Transaction Code for creating ZC Notification
Enter SAP Transaction
Create ZC Notification in Initial Screen
Create ZC Notification in Customer Contact


*** Keywords ***
Enter SAP Transaction
Execute Transaction /nIW51
Create ZC Notification in Initial Screen
Fill Text Field Notification type ZC
Push Button Enter

Create ZC Notification in Customer Contact
Input Text wnd[0]/usr/subSCREEN_1:SAPLIQS0:1060/txtVIQMEL-QMTXT CustomerNotification

Stefan-Schnell
Active Contributor
0 Likes

Hello @AutomationTester,

as far as I can see is the path of your ID not complete.

In your case:

 

wnd[0]/usr/subSCREEN_1:SAPLIQS0:1060/txtVIQMEL-QMTXT

 

In my case:

 

wnd[0]/usr/subSCREEN_1:SAPLIQS0:1060/subNOTIF_TYPE:SAPLIQS0:1061/txtVIQMEL-QMTXT

 

stefan_schnell_0-1717657804029.png

The field txtVIQMEL-QMTXT is part of a GuiSimpleContainer and this must be part of the ID. I assume that is what you are missing.

But please analyze your path before to see whether it is identical or possibly different.

Best regards
Stefan

AutomationTester
Explorer
0 Likes

Thanks @Stefan-Schnell, I use Scripting Tracker to find the Element Id but i always get ->session.findById("wnd[0]/usr/subSCREEN_1:SAPLIQS0:1060/txtVIQMEL-QMTXT").text in the recorder. I also tried to record in SAP GUI using recording and Playback, even the same element id i can see in.VBS File. As I am new to Robotframework with robosapiens/SAp GUI Library, not sure whether you are identifying the element in similar way or in different way

Stefan-Schnell
Active Contributor
0 Likes

Hello @AutomationTester,

that's nothing unusual, then you are certainly using a different backend version than I am. You are sure that this is the right ID, that's good.

A suggestion: Record the filling of the field with the SAP GUI Scripting Recorder as VBS and play it back. Your script should then have one interesting line:

 

session.findById("wnd[0]/usr/subSCREEN_1:SAPLIQS0:1060/txtVIQMEL-QMTXT").text = "yourValue"

 

Execute the script and see what happens. If this works, the faulty behavior must be in the RoboSAPiens script. Otherwise, the reason of the misconduct must be searched elsewhere.

Best regards
Stefan

AutomationTester
Explorer

Hi @Stefan-Schnell, as mentioned in the comment already .VBS File executed for the following code successfully. session.findById("wnd[0]/usr/subSCREEN_1:SAPLIQS0:1060/txtVIQMEL-QMTXT").text = "TestAutomation". I am using SAP 750 Version. Not sure whats the issue in SapGUiLibrary. Its not issue with Robosapiens. I am trying to use Input Text  wnd[0]/usr/subSCREEN_1:SAPLIQS0:1060/txtVIQMEL-QMTXT CustomerNotification which is part of SAPGUilibrary's Keyword. The text field which I am trying to enter the value does not have Label for it so couldn't use Robosapiens.

AutomationTester
Explorer
0 Likes

Hi @Stefan-Schnell , I jus tried to execute my script in SAP Version 800. Getting same AttributeError: 'int' object has no attribute 'findById'. Any fields with label can be identified using Fill Text Field Keyword in Robosapiens. Not Sure why Input Text in SAP GUI Library is not identifying the Element Id

Stefan-Schnell
Active Contributor
0 Likes

Hello @AutomationTester,

I don't know RoboSAPiens but I can't find the keyword Input Text in the list of keywords.

Could it be possible that you mean instead of

Input Text wnd[0]/usr/subSCREEN_1:SAPLIQS0:1060/txtVIQMEL-QMTXT CustomerNotification

this

Fill Text Field VIQMEL-QMTXT CustomerNotification

as far as I understand the technical documentation correct.

Best regards
Stefan

AutomationTester
Explorer
0 Likes

Hi @Stefan-Schnell, The text field with the locator 'VIQMEL-QMTXT' could not be found. Hint: Check the spelling. The above code didnt work because Fill Text Field expects label of the the text field so following command didnt work "Fill Text Field VIQMEL-QMTXT CustomerNotification".  I was using SAP GUI Library's Keyword(Input Text). I think I found the issue: I tried to use both SAP GUI Library and Robosapiens which is wrong. I made SAP Connection using Robosapiens and trying to enter a text field value using SAP Gui Library Keyword. Let me try to use only one Library and see whether it works. Thanks!

I am new to SAP Automation using Robot Framework. I have done SAP Automation using Commercial Product now looking for a Open Source to automate SAP Desktop GUI. Which option is good? Shall I go with Python and Robot Framework or SAP GUI Library & Robot Framework or any other option? Please suggest. Thanks!

Stefan-Schnell
Active Contributor
0 Likes

Hello @AutomationTester,

that is an interesting constellation. Please let us know what exactly caused the error.

Making a recommendation is not that easy. It depends on many factors, such as which programming languages are permitted, what expertise is available in the company, etc. On the other hand I have not looked into other OSS solutions for SAP GUI automation, so I cannot recommend any or it would be very difficult for me to do that. Hope you understand that. When I automate the SAP GUI for Windows, I primarily use PowerShell without any abstraction layer - that is my most effective way.

Best regards
Stefan

Ask a Question