Reputation: 163
I am trying to run the below code, but it throws and error when executing the last line of code.
Browser("name:=401K Calculator").Page("title:=401K Calculator").WebEdit("name:=age").Set 26
Browser("name:=401K Calculator").Page("title:=401K Calculator").WebEdit("name:=retirementage").Set 70
Browser("name:=401K Calculator").Page("title:=401K Calculator").WebEdit("name:=lifeexpectancy").Set 80
Browser("name:=401K Calculator").Page("title:=401K Calculator").WebEdit("name:=income").Set 50000
Browser("name:=401K Calculator").Page("title:=401K Calculator").WebEdit("name:=incomeincrease").Set 3
Browser("name:=401K Calculator").Page("title:=401K Calculator").WebEdit("name:=balance").Set 150000
Browser("name:=401K Calculator").Page("title:=401K Calculator").WebEdit("name:=contribution").Set 10
Browser("name:=401K Calculator").Page("title:=401K Calculator").WebEdit("name:=inflation").Set 5
Browser("name:=401K Calculator").Page("title:=401K Calculator").Image("file name:=calculate.png","index=0").Click
When I use Object spy on the button (image), it shows its name as"image" instead Button.
I am using the script on http://www.calculator.net/401k-calculator.html website.
Here is the error: "Object doesn't support this property or method: 'Browser(...).Page(...).Image'"
What should I change in order to get it to work?
Upvotes: 3
Views: 745
Reputation: 114705
The description you gave for the calculate button is:
"file name:=calculate.png","index=0"
The first part is fine but in the index
part you forgot the :
that tells UFT you're using descriptive programming. It should be:
"file name:=calculate.png","index:=0"
' You forgot this ^
Upvotes: 3