tags:

views:

68

answers:

1

how to use different operators in QTP for example

Window("text:=Calculator").WinButton("text:= =").Click
Window("text:=Calculator").WinButton("text:= +").Click

it doen't work for me when i run this i am getting error like this

Cannot identify the object "[ WinButton ]" (of class WinButton). Verify that this object's properties match an object currently displayed in your application.

+3  A: 

The problem (according to the error message) is in the identification not the action (operator as you call it)

The problem is that when you use descriptive programming the description is treated as a regular expression, the character + has special meaning in regular expressions (it means one or more of the preceding (in you case space). Try escaping the plus (with a backslash).

Window("text:=Calculator").WinButton("text:= \+").Click
Motti