Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to verriy Class in Mercury tour
#1
Not Solved
In Mercury Tours web application, I want to verify the selected Service Class ( Economy,Business,First) should display in Summary of Book a Flight page.

I have Parametrized the Class. I have added standard Output checkpoint.
But as the Class changes, the Webelement also chnages which causes to fail the test.
Code:
WebElement("Business").Output CheckPoint("Business_3")
In above line "Business" get changes to "First", also "Business_3" changes to "First_3"

Will anyone help how to solve this.
Should Standard Checkpoint should be appropriate for this along with and Regular expression ?

Below is my recorded script.
Code:
Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("userName").Set "mercury"
Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("password").SetSecure "4d21fea06bee0654680dc50f16afca4d1386c70f"
Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").Image("Sign-In").Click 19,12
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("fromPort").Select "Frankfurt"
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("fromDay").Select "10"
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("toPort").Select "Paris"
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("toDay").Select "14"
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebRadioGroup("servClass").Select DataTable("Class", dtGlobalSheet)
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").Image("findFlights").Click 42,15
Browser("Welcome: Mercury Tours").Page("Select a Flight: Mercury").Image("reserveFlights").Click 48,14
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebElement("Business").Output CheckPoint("Business_3")
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebElement("Business_2").Output CheckPoint("Business_4")
Reply
#2
Not Solved
Regular Expression will not be helpful here. It would match the webelement, but then be unable to output the correct checkpoint. Best option would be an if statement and use the Exists function
Code:
if Browser("Welcome: Mercury Tours").Page("Book a  Flight:Mercury").WebElement("Business").Exists(5) then
  Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebElement("Business").Output CheckPoint("Business_3")
else if Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebElement("Business_2").Exists(5) then
   Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebElement("Business_2").Output CheckPoint("Business_4")
end if

Hope this helps.
Reply
#3
Not Solved
Hi I have Put Text output value to get run time Text displayed for different iteration. I am able to get expected text output for first Data.
But for rest I am getting blank value.
Please find the below code.
Code:
Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("userName").Set "mercury"
Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("password").SetSecure "4d2496e99823041ab2967b1e5a53f5b8b003ec3c"
Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").Image("Sign-In").Click 20,10
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("fromPort").Select "Frankfurt"
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("toPort").Select "London"
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("fromDay").Select "6"
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("toDay").Select "11"
For i=1 to Datatable.GetRowCount
Datatable.SetCurrentRow(i)
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebRadioGroup("servClass").Select DataTable("Class", dtGlobalSheet)
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").Image("findFlights").Click 33,6
Browser("Welcome: Mercury Tours").Page("Select a Flight: Mercury").Image("reserveFlights").Click 24,13
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").Output CheckPoint("Book a Flight: Mercury Tours")
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").Image("buyFlights").Click 47,15
msgbox Datatable.Value("Book_a_Flight_MercuryOutput_Text_out", dtglobalsheet)
Browser("Welcome: Mercury Tours").Page("Flight Confirmation: Mercury").Image("backtoflights").Click
Next

Can any one guide why second and third values are blank ?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  cant create activex object for Mercury.ObjectRepositoryUtil in Windows 7 64-bit gtamboli 3 5,261 11-14-2012, 08:34 PM
Last Post: Ankesh

Forum Jump:


Users browsing this thread: 1 Guest(s)