I have an Oracle application that needs to check the Java toolbar to see if a selection is enabled. I added the JavaToolBar to the OR by running QTP with the Java addin and not the Oracle addin. Normal running of the script will have both addins enabled.

The code I am using to get information on the toolbar looks like:

ToolBarContent = JavaWindow("Oracle Applications -").JavaToolbar("ToolBar").GetContent
ToolName = JavaWindow("Oracle Applications -").JavaToolbar("ToolBar").GetItem(1)
ToolCount = JavaWindow("Oracle Applications -").JavaToolbar("ToolBar").GetItemsCount
ToolSelection = Javawindow("Oracle Applications -").JavaToolbar("ToolBar").GetSelection

When each of these lines are executed I get the error "The operation cannot be performed"

Any ideas why?