How to Get Oracle ERP Status bar Message in UFT
In our day to day scenario, who works on Oracle ERP automation testing, they face this problem very often.
Here is code or function to get the status message from an Oracle ERP.
Set obj_ORAStatus=description.Create If oraclestatusline(obj_ORAStatus).exist Then ERP_Get_StatusMessage=OracleStatusline(obj_ORAStatus).getROProperty("message") End If Set obj_ORAStatus=nothing End Function
There is another classic solution provided here in this forum
By default, the Object Spy only shows Oracle recognition against Oracle Test Object when the add-in is enabled, so either of the following can be done to get Java recognition instead of Oracle temporarily:
- Close current UFT instance
- We need to launch UFT with add-ins Java and Web
- We can take a backup for the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Mercury Interactive\JavaAgent\Oracle Add-in for QuickTest\Enabled [this is to return to previous settings/functionality if needed]
- Now set its value to zero (0)
- We need to restart UFT with Oracle and Web add-ins.
The status bar few a times show a syntax such as “Record: 1/?” where the question mark (“?”) represents that Oracle hasn’t calculated or analyzed the table completely, thus not determining how many rows or records are on the table.
This requires forcing Oracle to analyze the displayed table and find the last record to change the question mark (?) for the real number representing the last record or row of it.
It’s possible to force Oracle to find that last record of the table via its own menu options:
- We need to open the Oracle application menu called “View”
- Navigate the menu until “Record” is seen
- Within the displayed sub-items of “Record”, select “Last”
- Oracle will display a “Process” dialog window indicating “Retrieving next 100 records”.
- If the amount of rows goes higher than the mentioned 100 records, then a “Decision” dialog window will appear and in order to get to the last record, selecting “Continue to End”.
If UFT is used to automating these steps, then something similar to the following code could result:
OracleFormWindow("...").SelectMenu "View->Record->Last" If OracleNotification("Decision").Exist Then OracleNotification("Decision").Choose "Continue to End" End if
Getting the text of Status Bar using Object.StatusText property of Browser object
As per motevich, we can follow the below code to get the browser status message:
sMyText = Browser("name of the browser").Object.StatusText MsgBox sMyText
Getting text of Status Bar using GetROProperty(“text”) method of WinStatusBar object
sMyText = Browser("name of the browser").WinStatusBar("msctls_statusbar32").GetROProperty("text") MsgBox sMyText