Ivan Gerasimenko
Ivan Gerasimenko

Reputation: 2428

How to check property of JavaToolbar button with UFT/QTP?

There is a toolbar in the java application with buttons: ..., security, tools, login, logout.

java toolbar

UFT object spy can reach down to a certain button, but in script (descriptive programming) UFT can only see JavaToolbar.

nowYouSeeMe = JavaWindow("label:=WinTitle").JavaToolbar("attached text:=ToolbarName").Exist(0)    'True
nowYouDoN_t = JavaWindow("label:=WinTitle").JavaToolbar("attached text:=ToolbarName").JavaButton("label:=logout").Exist(0)    'False

So I can not get property, e.g. enabled, of a certain button. Just can press it like:

JavaWindow("label:=WinTitle").JavaToolbar("attached text:=ToolbarName").Press "logout"

Is there any possibility to get property of a button? (Guess it should be the same like in JavaMenu, get property of menu item)

Upvotes: 1

Views: 782

Answers (1)

Sujit
Sujit

Reputation: 56

For JavaToolbar have you checked GetItemProperty() method.

Here is the code I have checked with my AUT which is developed in JAVA.

Msgbox JavaWindow("DefaultWindow").JavaToolbar("Toolbar").GetItemProperty("Tools","enabled")

Please check with remaining buttons and pass only tool tip text of all buttons in GetItemProperty() method.

Upvotes: 3

Related Questions