tags:

views:

34

answers:

1

I am using the following code but the toolbar button doesnt get accessed at all. The error is "unknown error"

Window(window_name).WinToolBar("Example Toolbar").Press "Print"

Here Example Toolbar is added to the object repo, and gets highlighted correctly.

+1  A: 

Are you sure the error is Unknown Error and not Cannot identify the specified item of the Standard object....

Perhaps you're using the wrong name, this will give you the names of the items in the WinToolBar

MsgBox Window(window_name).WinToolBar("Example Toolbar").GetContent()
Motti
Failed to run the test due to an unknown error.Line (317): "msgbox( Window(window_name).WinToolBar(""Example Toolbar").GetContent())".
Onnesh
@Onnesh, in that case I don't know what may be wrong, can you try to do `Window(window_name).WinToolBar(""Example Toolbar").Highlight` and see if it works (as it does from the repository).BTW if I didn't solve your problem why did you accept my answer? You have a better chance to get a helpful answer if you don't accept this one. (It also seems strange to me to accept an answer and not up-vote it but that may just be me...)
Motti
@Motti, it seems the problem got solved, the highlight may not be needed. since i didnt know the steps how it got solved but after I used ur code and removed it, the steps suddenly worked correctly :)
Onnesh
@Onnesh, it's a kind of magic ;o)
Motti