Micro Focus QTP (UFT) Forums
Error - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Error (/Thread-Error--5973)



Error - shwetha_m - 02-01-2012

Hi,
please let me know the syntax of descriptive programing is correct for the below mentimoed script.
I am retrieveing the EMI using Descriptive Programing.

Code:
systemutil.Run"iexplore.exe","http://www.homeloanshub.com/mortgage-calculator/"
Browser (name:="Mortgage Calculator").page(title:="Mortgage Calculator").webedit("principal").set"1000000"
Browser (name:="Mortgage Calculator").page(title:="Mortgage Calculator").webedit("interest").set"2"
Browser (name:="Mortgage Calculator").page(title:="Mortgage Calculator").webedit("tenure").set"5"
Browser (name:="Mortgage Calculator").page(title:="Mortgage Calculator").webbutton("Calculate").Click

when i run the above script the error displays as:

"The test run cannot continue due to a syntax error.

Expected ')'

Line (1):
Code:
"Browser (name:="Mortgage Calculator").page(title:="Mortgage Calculator").webedit("principal").set"1000000"".


please can any one assist on this.

Regards,
Shwetha


RE: Error - mwietrzyk - 02-01-2012

Hi,

Try this

Code:
Browser("Mortgage Calculator").Page("Mortgage Calculator").WebEdit("principal").Set "1000000"
Browser("Mortgage Calculator").Page("Mortgage Calculator").WebEdit("interest").Set "5"
Browser("Mortgage Calculator").Page("Mortgage Calculator").WebEdit("tenure").Set "2"
Browser("Mortgage Calculator").Page("Mortgage Calculator").WebButton("Calculate").Click

Cheers,
Matt


RE: Error - dreiseitel - 02-01-2012

Thats how it works:


systemutil.Run"iexplore.exe","http://www.homeloanshub.com/mortgage-calculator/"

Code:
Browser ("name:=Mortgage Calculator").page("title:=Mortgage Calculator").webedit("name:=principal").set "1000000"
Browser ("name:=Mortgage Calculator").page("title:=Mortgage Calculator").webedit("name:=interest").set "2"
Browser ("name:=Mortgage Calculator").page("title:=Mortgage Calculator").webedit("name:=tenure").set "5"
Browser ("name:=Mortgage Calculator").page("title:=Mortgage Calculator").webbutton("name:=Calculate").Click

Regards

Heiko