Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
UFT doesn't recognize object in SAP at first, but recognize it after i click debug
#1
Not Solved Exclamation 
Hello,

I work on UFT 12.52 build 6851 with SAP 730
I already have some tests, and now i want to create a test that will launch SAP and login. When i get to the connection window, UFT cannot recognize the object.
What is really weird is that if i click on debug and then just after click the play button UFT will recognize the object.
Moreover, i noticed that if the SAP Logon window is already opened, UFT will find the connection at first try.

Thanks a lot for any insight you might have,
Cédric.

Error message :
[Image: 123741Capture.png]

My object repository is as follows, i can show you the other objects but the error message speak about the "session" object :
[Image: 47732461OR.png]

My code really isn't that particular, but if you need to see it :

Code:
If DataTable.GlobalSheet.GetCurrentRow = 1 Then
reporter.ReportEvent micDone,"Version", "Utilisation of action : '" & actionName & "' in the version : '" & version & "'"

SystemUtil.Run "C:\Program Files (x86)\SAP\FrontEnd\SAPgui\saplogon.exe","","C:\Program Files (x86)\SAP\FrontEnd\SAPgui",""   'Open SAP
Dialog("SAP Logon 730").WinListView("SysListView32").Activate DataTable("Server", dtGlobalSheet)  'Open the connection to the desired server
SAPGuiSession("Session").SAPGuiWindow("SAP").SAPGuiEdit("Client").Set DataTable("Client", dtGlobalSheet)    'Line that gets the error
SAPGuiSession("Session").SAPGuiWindow("SAP").SAPGuiEdit("User").Set DataTable("User", dtGlobalSheet)
SAPGuiSession("Session").SAPGuiWindow("SAP").SAPGuiEdit("Password").Set DataTable("Password", dtGlobalSheet)
SAPGuiSession("Session").SAPGuiWindow("SAP").SAPGuiEdit("Logon Language").Set DataTable("Language", dtGlobalSheet)
SAPGuiSession("Session").SAPGuiWindow("SAP").SendKey ENTER
End If
Reply
#2
Not Solved
A couple of things you can try -

  1. After Dialog() statement , can you put some wait(5). [We can optimize timing later.]
  2. As soon as SAPGUISession() window is opened, try getting the hwnd of it. Using Activate method activate the window to get it in foreground and then follow through rest of the steps.
Let us know if these work for you!
Reply
#3
Not Solved
Hi,


Setting a wait statement didn't correct the bug.

For the hwnd, i copied the code you provided but it didn't worked. Maybe i didn't implement it correctly however. I'm not really sure.

Code:
    'Step1: Simulate your action to bring the popup window
    'Click on the OK button in Login window which will simulate the popup window.
    SystemUtil.Run "C:\Program Files (x86)\SAP\FrontEnd\SAPgui\saplogon.exe","","C:\Program Files (x86)\SAP\FrontEnd\SAPgui",""
    Dialog("SAP Logon 730").WinListView("SysListView32").Activate DataTable("Server", dtGlobalSheet)
    'Step 2: Get the HWND of the popup window (assuming that the popup window is the top most window)
    'Declare the extern
    extern.Declare micLong,"GetForegroundWindow","user32.dll","GetForegroundWindow"
    'Get the top most window hwnd
    hwnd = extern.GetForegroundWindow()
    'Step 3: Assign the HWND value to the Object in OR.
    'set the hwnd value in object repository
    SAPGuiSession("Session").SetTOProperty "hwnd",hwnd
    'Step 4: Continue working with popup window as usual
    'perform operation on the top most window objects.
    SAPGuiSession("Session").SAPGuiWindow("SAP").SAPGuiEdit("Client").Set DataTable("Client", dtGlobalSheet)
    SAPGuiSession("Session").SAPGuiWindow("SAP").SAPGuiEdit("User").Set DataTable("User", dtGlobalSheet)
    SAPGuiSession("Session").SAPGuiWindow("SAP").SAPGuiEdit("Password").Set DataTable("Password", dtGlobalSheet)
    SAPGuiSession("Session").SAPGuiWindow("SAP").SAPGuiEdit("Logon Language").Set DataTable("Language", dtGlobalSheet)
    SAPGuiSession("Session").SAPGuiWindow("SAP").SendKey ENTER
Reply
#4
Not Solved
Sorry, i know that this thread is quite old, but i have the same problem by trying to select/activate an object in SAP

could you fix this problem? if yes, please tell me how to fix it

thanks
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Object doesn't support this property or method takecharge 1 1,342 11-13-2019, 10:05 PM
Last Post: stormbringer
  [UFT 12.52/VBScript] Test object exist, is visible and enabled before take an action sparkwanted 0 3,437 02-07-2017, 12:28 AM
Last Post: sparkwanted
  Object doesn't support this property or method: 'window(...).window(...).winobject' senthil5683 1 3,490 07-04-2016, 07:08 PM
Last Post: venkatesh9032
  UFT Mobile recognize MobileLabel knil45 3 3,241 05-31-2016, 05:20 PM
Last Post: vinod123
  How to click on all links dynamically in UFT? Rohan 9 17,876 02-25-2016, 10:42 AM
Last Post: vinod123

Forum Jump:


Users browsing this thread: 1 Guest(s)