frankvanderkuur / robotframework-sapguilibrary

A Robot Framework Library for automating the SAP GUI desktop client
Apache License 2.0
51 stars 22 forks source link

Robot Framework With Sap Gui Library. Sample Robot Framework code for SAP app? #5

Open Murugan1981 opened 5 years ago

Murugan1981 commented 5 years ago

Dear Sir, I am new to Robot Framework. I have installed Sap Gui Library using pip install robotframework-sapguilibrary.

I am struggling to get started with Settings Library DatabaseLibrary Library OperatingSystem Library SikuliLibrary Library SapGuiLibrary Variables ${SAPSessionID} ID ${SAPSessionUser} username ${SAPSessionPWD} password Test Cases SAPApplication SikuliLibrary.Open Application C://Automation//RobotFramework//saplogon.exe Sleep 20 Maximize Window 0
Connect To Existing Connection 148 Sleep 20

    SapGuiLibrary.Set Focus  "findById" @("wnd[0]/usr/txtRSYST-BNAME")

I am getting the below error - Connects to an open connection. If the connection matches the given connection_name, the session is connected to this connection.

AttributeError: 'int' object has no attribute 'Children'

chiranjeevibmse commented 5 years ago

i have written in my blog this may help you. But i have not written code to open SAPLogon, i have kept open

mytzenka commented 5 years ago

I would start saplogon.exe using the keyword "start process" from the Robot framework Process library instead of Sikuli. Once you have started the logon you need to use "connect to session" to connect. Then you open the connection you want using "open connection".

Since you do need to wait until saplogon.exe has started "connect to session" would fail if you try to fast. Therefor you can run that keyword using the Robot framework retry keyword: "wait until keyword succeeds".

Example:

* Settings ** Library Process Library SapGuiLibrary

Test Cases Start logonpad Start Process C:/Program Files (x86)/SAP/FrontEnd/SAPgui/saplgpad.exe wait until keyword succeeds 30s 1s connect to session open connection ${connection_name_you_want}

WerdaGr commented 5 years ago

Hi, I am new to SAP and Robot Framework. Thank you for the code above, I am able to open the saplgpad but I am unsure what connection name to use, how do I determine the connection name? Thanks in advance

coxcs1 commented 4 years ago

Hi, I can open the SAP Logon Pad however I cannot connect to the session.. any suggestions? Thanks.

Settings Library SapGuiLibrary screenshots_on_error=False Library OperatingSystem

Variables ${CONNECTION} "(1-A) Production ERP System" ${PROCESS} "C:\Program Files (x86)\SAP\FrontEnd\SAPgui\saplgpad.exe" Test Cases Open SAP Run ${PROCESS} Sleep 30 Connect to Session Open Connection ${CONNECTION}

shanst commented 4 years ago

Hi, I am new to SAP and Robot Framework. Thank you for the code above, I am able to open the saplgpad but I am unsure what connection name to use, how do I determine the connection name? Thanks in advance

Hi, Were you able to figure out how to connect and what is the connection name?

Tikina005 commented 4 years ago

hi all, how we can identify locators in sap application? do we have any open source tool...

joseiltoncorreia commented 3 years ago

hi all, how we can identify locators in sap application? do we have any open source tool...

Hi,

You can do this in two ways:

  1. Using the SAP Scripting Tracker tool (its free)
  2. Using SAP's own Record and Playback tool
shaasuhaimi commented 3 years ago

Hi, I am new to SAP and Robot Framework. Thank you for the code above, I am able to open the saplgpad but I am unsure what connection name to use, how do I determine the connection name? Thanks in advance

Hi, I am also new in automation and SAP. Can someone give a clue on how to determine the connection name? and I'm having "PermissionError: [WinError 5] Access is denied" to open the logpad. Is it bcs it is in the programe files(86)?

"\"C:Program Files (x86)SAPFrontEndSapGuisaplogon.exe\"" 20210909 19:40:59.992 : FAIL : PermissionError: [WinError 5] Access is denied

joseiltoncorreia commented 3 years ago

Hi, I am new to SAP and Robot Framework. Thank you for the code above, I am able to open the saplgpad but I am unsure what connection name to use, how do I determine the connection name? Thanks in advance

Hi, I am also new in automation and SAP. Can someone give a clue on how to determine the connection name? and I'm having "PermissionError: [WinError 5] Access is denied" to open the logpad. Is it bcs it is in the programe files(86)?

""C:Program Files (x86)SAPFrontEndSapGuisaplogon.exe"" 20210909 19:40:59.992 : FAIL : PermissionError: [WinError 5] Access is denied

Hi Shaasuhaimi, The connection name is what you fill in in the field Description when you are creating your Connection in the SAP Logon. SAP Logon

shaasuhaimi commented 3 years ago

Hi, I am new to SAP and Robot Framework. Thank you for the code above, I am able to open the saplgpad but I am unsure what connection name to use, how do I determine the connection name? Thanks in advance

Hi, I am also new in automation and SAP. Can someone give a clue on how to determine the connection name? and I'm having "PermissionError: [WinError 5] Access is denied" to open the logpad. Is it bcs it is in the programe files(86)? ""C:Program Files (x86)SAPFrontEndSapGuisaplogon.exe"" 20210909 19:40:59.992 : FAIL : PermissionError: [WinError 5] Access is denied

Hi Shaasuhaimi, The connection name is what you fill in in the field Description when you are creating your Connection in the SAP Logon. SAP Logon

Hi joseiltoncorreia, Thank you so much, really apreaciate it! I already manage to automate open the SAP GUI and connect to the session. Thanks

DhinaStark commented 2 years ago

Hi i am new to SAP gui and rpa and im also facing the same issue im not sure about the connection name image This is the name of the connection i want to connect to but its throwing an error "ValueError: Cannot open connection '40 R40 S/4 AS2B Recette', please check connection name.". Sap logon pad is opening fine but not able to connect to a session

This is my code Variable ${sap_connection}= 40 R40 S/4 AS2B Recette Test case SapGuiLibrary.Connect To Session SapGuiLibrary.Open Connection ${sap_connection}

DhinaStark commented 2 years ago

Hi, I am new to SAP and Robot Framework. Thank you for the code above, I am able to open the saplgpad but I am unsure what connection name to use, how do I determine the connection name? Thanks in advance

Hi, I am also new in automation and SAP. Can someone give a clue on how to determine the connection name? and I'm having "PermissionError: [WinError 5] Access is denied" to open the logpad. Is it bcs it is in the programe files(86)? ""C:Program Files (x86)SAPFrontEndSapGuisaplogon.exe"" 20210909 19:40:59.992 : FAIL : PermissionError: [WinError 5] Access is denied

Hi Shaasuhaimi, The connection name is what you fill in in the field Description when you are creating your Connection in the SAP Logon. SAP Logon

Hi joseiltoncorreia, Thank you so much, really apreaciate it! I already manage to automate open the SAP GUI and connect to the session. Thanks

Hi may i know how u got it to work bcz im also facing the same issue. Im getting the following error "ValueError: Cannot open connection '40 R40 S/4 AS2B Recette', please check connection name."