Micro Focus QTP (UFT) Forums
Parameters - 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: Parameters (/Thread-Parameters--2555)

Pages: 1 2


Parameters - renser - 10-20-2009

I have a test that runs through an insurance quote web site with. There are two test iterations. I've parameterised one screen input with two variables in the data table. On the second iteration I'm getting an error because the second variable changes the insurance answer after the calculation and the test does not recognise the second answer. There are two text checkpoints. The second one fails. I've tried using an output values but it did not work. See the attachment. The web site is Can anyone help?


RE: Parameters - Saket - 10-21-2009

I can t find the attachment, can you upload it again?


RE: Parameters - renser - 10-21-2009

[attachment=303]


Saket,
I have attached the screen prints. The test is to record entering variables into an insurance quotation website www.hibernian.ie\online (car insurance) then get an answer. Add a check point on the quotation answer and parameterise one of the variables and run two iterations. The second iteration fails because the second variable in the data table changes quotation answer. If you could suggest a better way to do the test that is great. I have'nt run any tests yet that involve writing Visual Basic script but I do have some knowledge of VB.

Thank you,

Renser


RE: Parameters - Saket - 10-22-2009

I did not find any issue , may be you can try using getroproperty to get the amount or else paste your lines of code from expert view. I would like to have a look on that.


RE: Parameters - renser - 10-22-2009

I did not find any issue , may be you can try using getroproperty to get the amount or else paste your lines of code from expert view. I would like to have a look on that.
[/quote]

Saket,
This is the code. I have made a space where the error occurs.

Code:
Browser("Browser").Dialog("Security Information").WinButton("Yes").Click
Browser("Browser").Dialog("Security Information").WinButton("Yes").Click
Browser("Browser").Page("Hibernian Aviva car insurance,").Image("Get a car quote").Click
Browser("Browser").Page("Car insurance quote and").Image("Get a car quote").Click
Browser("Browser").Dialog("Windows Internet Explorer").WinButton("OK").Click
Browser("Browser").Page("Car insurance quote and").WebCheckBox("acceptedTerms").Set "ON"
Browser("Browser").Page("Car insurance quote and").Image("Get a car quote").Click
Browser("Browser").Page("Car Insurance - Basic").WebEdit("proposer.dob").Set "23/09/1971"
Browser("Browser").Page("Car Insurance - Basic").WebRadioGroup("proposer.gender").Select DataTable("Gender", dtGlobalSheet)
Browser("Browser").Page("Car Insurance - Basic").WebEdit("proposer.contactDetail.email").Set "tt@hotmail.com"
Browser("Browser").Page("Car Insurance - Basic").WebList("proposer.districtCode").Select "Dublin 6"
Browser("Browser").Page("Car Insurance - Basic").WebRadioGroup("licenceDuration").Select "5"
Browser("Browser").Page("Car Insurance - Basic").WebList("proposer.drivingHistory.licenc").Select "Full Irish"
Browser("Browser").Page("Car Insurance - Basic").WebList("proposer.drivingHistory.ncdYea").Select "1"
Browser("Browser").Page("Car Insurance - Basic").WebList("proposer.drivingHistory.ncdSou").Select "Insurance Policy in your own name"
Browser("Browser").Page("Car Insurance - Basic").WebList("proposer.drivingHistory.curren").Select "FBD Insurance"
Browser("Browser").Page("Car Insurance - Basic").WebList("proposer.drivingHistory.penalt").Select "1"
Browser("Browser").Page("Car Insurance - Basic").WebList("proposer.drivingHistory.annual").Select "5,001 - 10,000 miles / 8,001 - 16,000km"
Browser("Browser").Page("Car Insurance - Basic").WebRadioGroup("policy.numOtherHibPolicies").Select "0"
Browser("Browser").Page("Car Insurance - Basic").WebRadioGroup("vehicle.hybrid").Select "N"
Browser("Browser").Page("Car Insurance - Basic").WebList("vehicle.make").Select "Ford"
Browser("Browser").Page("Car Insurance - Basic").WebEdit("vehicle.dateFirstRegd").Set "1999"
Browser("Browser").Page("Car Insurance - Basic").WebEdit("vehicle.registrationNumber").Set "99D4536"
Browser("Browser").Page("Car Insurance - Basic").WebRadioGroup("vehicle.typeOfFuel").Select "P"
Browser("Browser").Page("Car Insurance - Basic").WebEdit("vehicle.cc").Set "1200"
Browser("Browser").Page("Car Insurance - Basic").WebEdit("vehicle.approxValue").Set "7000"
Browser("Browser").Page("Car Insurance - Basic").WebRadioGroup("vehicle.leftHandDrive").Select "N"
Browser("Browser").Page("Car Insurance - Basic").Link("Get your quote").Click

'The following line is where the error happens on the 2nd iteration
Code:
Browser("Browser").Page("Car Insurance - Quick").Link("€868.54€910.13€41.59Just").Click

Browser("Browser").Page("Car Insurance - Quick").Check CheckPoint("Quote")
Browser("Browser").Page("Car Insurance - Quick").Link("Price breakdown").Click
Browser("Browser").Page("Car Insurance - Quick").Link("Basic Details").Click



RE: Parameters - Saket - 10-23-2009

This is because in the second iteration QTP does find a link with the text as in the OR.
try regularising the text of Link in your repository. May be something like ".*Just" will do.
let me know the out come.

also, always put your code in proper tags that makes the post much readable.
I am not able to go to the required page on your application today ( web page can not display the page ), so not able to do much with your code.


RE: Parameters - renser - 10-23-2009

Saket,
I am only a beginner with QTP. Some of your answer I don't understand.
Maybe you could give an example of "*just" and "regularising the text of Link in your repository", also using tags (I could not use any of this web sites formatting icons such as Bold, clicking the icon enters [B] into the message.
The web site address iI am performing the test on is http://www.hibernian.ie/online/ then choose car insurance.
Thank you for spending your time.

Renser[/code]


RE: Parameters - jsknight1969 - 10-23-2009

What he means by "regularizing" is using Regular expressions.

You link object problably has a text value of "€868.54€910.13€41.59Just".

You can change the text value to a regular expression in the OR properties area to ".*Just" which means "any text that ends with Just". Double click the text property of your object to set it to a regular expression and the value.

That way if the link is dynamically changing during your testing it will still be properly identified.

hope that helps.


RE: Parameters - renser - 10-24-2009

Thanks for your help but the problem remains. I change the OR text description to .*Just and the object name to just but I'm still getting an error when the second iteration executes the second insurance quotation. I have attached some screen prints. Can you help?
Thank you


RE: Parameters - Saket - 10-26-2009

Search this forum or in QTP help to know how to make regualr expression in OR.
You will need to regularise the Text property of link.
Some thing like in attached snapshot will help.