Skip to Content
0

how to handle status bar using QTP/UFT

Feb 07 at 05:24 PM

103

avatar image
Former Member

If i want to store numeric value from the status bar massage which is alphanumeric text how to do that using vb scripting

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Stefan Schnell
Feb 07 at 05:33 PM
0

Hello Soumojyoti,

welcome in the SAP Community.

Your question is a little bit unclear. Please describe your environment and your problem in more detail in the future. Help us to help you.

Unified Functional Testing (UFT), formerly known as QuickTest Professional (QFT), is an automation functional testing tool originally from Mercury Interactive which was acquired by Hewlett Packard. UFT is primarily used for functional, regression and service testing.

You can get the status bar text in VBScript like this

StatusBarText = session.findById("wnd[0]/sbar/pane[0]").Text

Now you can find the content of the status bar in the variable StatusBarText.

Best regards
Stefan

Show 1 Share
10 |10000 characters needed characters left characters exceeded

further to the text, you can retrieve several other interesting attributes from the SBAR

ErrNumber = session.FindById("wnd[0]/sbar/").MessageNumber 

(this is the Message Number)

ErrType = session.FindById("wnd[0]/sbar/").MessageType

(this is the Message class keep in mind, this will include all the whitespace at the end)

 ErrText = session.FindById("wnd[0]/sbar/").text

(this is the short text that gets displayed in the status bar whenever a feedback message is presented)

using these attributes you can test for specific message ID / Numbers.

1
avatar image
Former Member Feb 08 at 07:15 AM
0

I am giving you a sample satus text

"The materiel 123456 is saved "

Now I want to store "123456" value to my data table.

Plz explaine me how to do

Share
10 |10000 characters needed characters left characters exceeded
Stefan Schnell
Feb 08 at 07:17 AM
0

Hello Soumojyoti,

try this to extract a numeric value from the status bar text:

StatusBarText = session.findById("wnd[0]/sbar/pane[0]").Text
'StatusBarText is: The material 123456 is saved
Set RegEx = CreateObject("vbscript.regexp") 
RegEx.Pattern = "[^\d]"
RegEx.IgnoreCase = True 
RegEx.Global = True 
NumberInStatusBarText = RegEx.Replace(StatusBarText, "") 
'Now you can find the number 123456 in the variable NumberInStatusBarText
MsgBox NumberInStatusBarText

Cheers
Stefan

Share
10 |10000 characters needed characters left characters exceeded