Monday, December 26, 2016

Perfecto Mobile Certification Assignment and My Community Posted Questions - live and Mini Project

11/04/2013 Version 1.0
11/07/2013 Version 2.0
11/12/2013 Version 3.0



Perfecto Mobile Certification Assignment
Precondition: go to device play store and install “Clear Trip” native application in iOS and Android.
Assignment:
10/30/2013 - UFT
CD92B696 – Android
C8PHXEKSDTF9 – ios 4s

10/30/2013 – PM
My Scripts\Meenakshi\ClrTrip_Assignment_Script
CD92B696 – Android
C8PHXEKSDTF9 – ios 4s


11/04/2013
Makemy Trip
Manufacturer: Samsung
Model: I747 Galaxy S III Digital
OS: Android
OS Version: 4.0.4
Location: US-MA-DEMO
Network: Verizon-United States of America
Phone number: +13399278836
Device ID: 991C4AED
Manufacturer: Apple
Model: iPhone-4S
OS: iOS
OS Version: 6.1.3
Location: US-MA-DEMO
Network: AT&T-United States of America
Phone number: +13399277427
Device ID: FB8FB261D67A3FD7126C1328F749EF886FE5A580
11/04/2013
Clear trip assignment main script.
My Scripts\Meenakshi Final Assignment\ClrTrip_Sun_Assignment_Main_Script

Manufacturer: Apple
Model: iPhone-4S
OS: iOS
OS Version: 5.1.1
Device ID: C8PHXEKSDTF9 - 11/06

Manufacturer: Samsung
Model: I747 Galaxy S III Digital
OS: Android
OS Version: 4.0.4
Location: US-MA-DEMO
Network: Verizon-United States of America
Phone number: +13399278836
Device ID: 991C4AED

11/11/13 Device used
Manufacturer: HTC
Model: One X JB
OS: Android
OS Version: 4.1.1
Location: US-MA-DEMO
Network: Verizon-United States of America
Phone number: +13399277335
Device ID: HT258W302348

User Defined Functions
1. ClrTrip_Sun_Login
My Scripts\Meenakshi\User function_Scripts\ ClrTrip_Sun _UDFVersion1.0\ ClrTrip_Sun _UDF_Login_Android .xml
My Scripts\Meenakshi\User function_Scripts\ ClrTrip_Sun_ UDFVersion1.0\ ClrTrip_Sun _UDF_Login_iOS .xml

2. ClrTrip_Sun_Selecting_Depart_date
My Scripts\Meenakshi\User function_Scripts\ ClrTrip_Sun _UDFVersion1.0\ ClrTrip_Sun_UDF_Depart Date_Android .xml
My Scripts\Meenakshi\User function_Scripts\ ClrTrip_Sun _UDFVersion1.0\ ClrTrip_Sun_UDF_Depart Date_iOS .xml

3. ClrTrip_Sun_Search for the flights
My Scripts\Meenakshi\User function_Scripts\ ClrTrip_Sun_UDFVersion1.0\ ClrTrip_Sun_UDF_Search_Flight_iOS .xml
My Scripts\Meenakshi\User function_Scripts\ ClrTrip_Sun_UDFVersion1.0\ ClrTrip_Sun_UDF_Search_Flight_Android .xml

4. ClrTrip_Sun _Sending Information Availability
My Scripts\Meenakshi\User function_Scripts\ ClrTrip_Sun_UDFVersion1.0\ ClrTrip_Sun_UDF_Sending_SMS_Flight_Is_Available .xml

5. ClrTrip_Sun _Sending Information Not available
My Scripts\Meenakshi\User function_Scripts\ ClrTrip_Sun_UDFVersion1.0\ ClrTrip_Sun_UDF_Sending_SMS_Flight_Not_Available .xml

6. ClrTrip_Sun _BackToHomePage
My Scripts\Meenakshi\User function_Scripts\ ClrTrip_Sun_UDFVersion1.0\ ClrTrip_Sun_UDF_Back_ To_Home_Page_iOS .xml
My Scripts\Meenakshi\User function_Scripts\ ClrTrip_Sun_UDFVersion1.0\ ClrTrip_Sun_UDF_Back_To_Home_Page_Android .xml


PRIVATE:script\ ClrTrip_Sun_MeenakshiImages\
ClrTrip_Sun_Login to Ios
PRIVATE:script\MeenakshiImages\ ClrTrip_Sun_Clear_Content_Image_iOS.png
ClrTrip_Sun_Back to home page ios
PRIVATE:script\MeenakshiImages\ ClrTrip_Sun_Back_to_homepage_cleartrip.png

ClrTrip_Sun_Selecting_Depart_date_Android
PRIVATE:script\MeenakshiImages\ ClrTrip_Sun_forward_image_Android.png

ClrTrip_Sun_Selecting_Depart_date_ios
PRIVATE:script\MeenakshiImages\ ClrTrip_Sun_Forward_calendar_iOS.png



My Scripts\ Meenakshi Final Assignment \ClrTrip_Sun_Assignment_Main_Script

Header for PM
'#################################################################################

'# Script Name : ClrTrip_Sun_Assignment_Main_Script

'# Test Case Name : ClrTrip_Sun_Assignment_Main_Script, Path : My Scripts/Meenakshi Final Assignment

'# Limitations                            :  Works for ios & android.                                                                                          

'# Script Description                     :  In Cleartrip Mobile Application we are entering From and To as MAA & LON and checking the availability,                         

'#                                           Finding Flight Information and sending availability details through Cloud SMS                                                 

'# Precondition                          :   Application "Cleartrip" from PlayStore and Appstore has to be Installed respectively.                                                   

'# Data : Select the Device Id of iOS and Android while execution from the device list.
'# Version Information                    :  Clear trip (Version  3.0.2)                                                                                                                                 

'# Date Created                           :  11/04/2013                    

'# Reviewer/ Review Date : Itzik Levi / 10/27/2013
# Review comments updated Date :  11/04/2013                    
'# Author                                 :  Sundar Technologies India                                                                                                

'‘####################################################################################

Itzik Levi [mailto:itzikl@perfectomobile.com] 

Sent: Sunday, October 27, 2013 3:36 AM - Review 1




Declaration Variables:
Name Type Value
DUT Handset
Application String Cleartrip
TypeOfTrip String one way
RunTimeMonthYear String
Month_YYYY String December 2013
DepartDate String 31
FromCity String Chennai
ToCity String London
Flight_Availability_infomation String

Month_YYYY String December 2013
Step 1 : Header file
'# Script Description : In Clear trip mobile app entering from and to as MAA & LON and checking the availability, Finding Flight Information and sending details through Cloud SMS #

Step 2 :Open Device
Note: Allocate devices automatically (has to be unchecked).







Step3:
  1. ClrTrip_Sun_UDF_Login
Comment: Opening the Cleartrip application
(Use find and search for “ClrTrip_Sun_UDF_Login ‘ to understand the flow)
Refer to : 1. ClrTrip_Sun_UDF_Login

Step 4:

Step 5:
10%

Step 6:



X


Step 7:

Step 8: ClrTrip_Sun_Selecting_Depart_Date

Refer to : ClrTrip_Sun_Selecting_Depart_Date


Step 9: ClrTrip_Sun_Search for the Flights
Refer to : 3. ClrTrip_Sun_Search for the Flights
Step 10:
Condition:
On Success
Availability udf ( ClrTrip_Sun _Sending Information for the Availability Flight )
Refer to: 4. ClrTrip_Sun _Sending Information for the Availability Flight
On Failure
Not Availability udf ( ClrTrip_Sun _Sending Not Available Flight Information )
Refer to: 5. ClrTrip_Sun _Sending Not Available Flight Information
Step 11: ClrTrip_Sun _BackToHomePage

Refer to : 6. ClrTrip_Sun _BackToHomePage

Step 12:

User Defined Functions
1. ClrTrip_Sun_UDF_Login
My Scripts\Meenakshi\User function_Scripts\ ClrTrip_Sun_ UDFVersion1.0\ ClrTrip_Sun _UDF_Login_iOS .xml
On success




Expected Image (needle) – Media- Constant : PRIVATE:script\MeenakshiImages\ClearContent_Image_for_iOS.png

Using Image Object Button for closing it.
Lable : PRIVATE:script\MeenakshiImages\ ClearContent_Image_for_iOS.png






If Success or Failure
We are executing 2 steps, those are same so we are moving out of the condition.
To avoid code replication.

My Scripts\Meenakshi\User function_Scripts\ ClrTrip_Sun _UDFVersion1.0\ ClrTrip_Sun _UDF_Login_Android .xml
  1. ClrTrip_Sun _UDF_Login_Android


2. ClrTrip_Sun_Selecting_Depart_Date
My Scripts\Meenakshi\User function_Scripts\ ClrTrip_Sun _UDFVersion1.0\ ClrTrip_Sun_UDF_Depart Date_iOS .xml
Comments - text-string – constant - “Selecting the Depart on”

$$$$ Setting Variable for the depart automatically at UDF.


Variable setting for the depart date UDF for iOS

Variable setting for the depart date UDF for iOS



Wait duration – Number – Constant - 3
Wait duration – Number – Constant - 3
Wait duration – Number – Constant - 3
Wait duration – Number – Constant – 3

Label – Media – Constant - PRIVATE:script\MeenakshiImages\Forward_calendar_iOS.png

My Scripts\Meenakshi\User function_Scripts\ ClrTrip_Sun _UDFVersion1.0\ ClrTrip_Sun_UDF_Depart Date_Android .xml


Wait duration – Number – Constant - 3


Loop – Parameters – repeat - 13
Wait duration – Number – Constant - 3

X RunTimeMonthYear
x

*
Lable – Media – constant - PRIVATE:script\MeenakshiImages\forward_image_Android.png
*
* It is must to give.
x
***Not need of Button.Click(text) in fail case/ Condition

3. ClrTrip_Sun_Search for the Flights
My Scripts\Meenakshi\User function_Scripts\ ClrTrip_Sun_UDFVersion1.0\ ClrTrip_Sun_UDF_Search_Flight_iOS .xml


My Scripts\Meenakshi\User function_Scripts\ ClrTrip_Sun_UDFVersion1.0\ ClrTrip_Sun_UDF_Search_Flight_Android .xml
X


No need of this UDF implement this in the actual script itself.

4. ClrTrip_Sun _Sending Information for the Availability Flight
My Scripts\Meenakshi\User function_Scripts\ ClrTrip_Sun_UDFVersion1.0\ ClrTrip_Sun_UDF_Sending_SMS_Flight_Is_Available .xml

Repository key – String – Constant - <<<old path PRIVATE:Meenakshi/ FlightAvailabilityInformation.txt>>>
PRIVATE:My Media/MeenakshiFlightInfoText/FlightAvailabilityInformation.txt


5. ClrTrip_Sun _Sending Information for Not Available Flight
My Scripts\Meenakshi\User function_Scripts\ ClrTrip_Sun_UDFVersion1.0\ ClrTrip_Sun_UDF_Sending_SMS_Flight_Not_Available .xml
Repository key – String – Constant - <<<old path PRIVATE:Meenakshi/ FlightAvailabilityInformation.txt>>>
PRIVATE:My Media/MeenakshiFlightInfoText/FlightAvailabilityInformation.txt

**** Moved the Cloud SMS Statement out of the Condition Statement (Single SMS code)
Sms – Device Setting as DUT at Destination device
6. ClrTrip_Sun _BackToHomePage
My Scripts\Meenakshi\User function_Scripts\ ClrTrip_Sun_UDFVersion1.0\ ClrTrip_Sun_UDF_Back_ To_Home_Page_iOS .xml
Label-Media-constant - PRIVATE:script\MeenakshiImages\Back_to_homepage_cleartrip.png

b) My Scripts\Meenakshi\User function_Scripts\ ClrTrip_Sun_UDFVersion1.0\ ClrTrip_Sun_UDF_Back_To_Home_Page_Android .xml


Images Path: My Media/ ClrTrip_Images in Media )
Data Tables Path: My Data Tables/Meenakshi_C/ (ClrTrip_Sun_ios_Android_DtTable in Media )
<<<User defined function mapping in PM>>>
UDF Path : ClrTrip_Sun_UDF
  1. ClrTrip_Sun_UDF_Login_Android
2. ClrTrip_Sun_Selecting_Depart_Date

3.ClrTrip_Sun_Search for the Flights


4. ClrTrip_Sun _Sending Information for the Available Flight
5. ClrTrip_Sun _Sending Not Available Flight Information



6. ClrTrip_Sun _BackToHomePage


*** The End of the Clear Trip***
We have 6 Tabs : Interactive, Automation, Reporting, Repository, Reservations, My Account

Data Table: At Repository Tab.
Example 1 : ClrTrip_Sun_iOS_Android_DtTable



Select two devices:

Example 2 : Did For Assignment2LoginDtTable








Assignment 2











Assignment 3
For iOs
For Android









Setting the data table inside the script or mapping the “Example 1 : ClrTrip_Sun_iOS_Android_DtTable”

Dt table main script setting


*** End of Assignment ***

Header for UFT
'#################################################################################

'# Script Name                            :  Final Assignment                                                                                                    #

'# Test Case Name                         :  Name Assignment5, path D:\Assignment5                                                                              #

'# Limitations                            :  Works for ios & android.                                                                                          

'# Script Description                     :  In Cleartrip mobile Application we are entering From and To as MAA & LON and checking the availability,                         
'#                                           Finding Flight Information and sending availability details through Cloud SMS                                                 
'# Precondition                          :   Application "Cleartrip" from PlayStore and Appstore has to be Installed respectively.                                                   
'# Data                                      :  Enter the Device Id of iOS and Android in Global sheet Device column                                             
'# Version Information                    :  Clear trip (Version  3.0.2)                                                                                       
constraint.                                                                                
'# Date Created                           :  11/04/2013                    

'# Author                                 :  Sundar Technologies India                                                                                                

'‘####################################################################################


Dt: 11/7/2013 – till 6.30pm
Manufacturer: HTC
Model: One X JB
OS: Android
OS Version: 4.1.1
Location: US-MA-DEMO
Network: Verizon-United States of America
Phone number: +13399277335
Device ID: HT258W302348

Dt: 11/7/2013 – after till 6.30pm
Manufacturer: Samsung
Model: I747 Galaxy S III Digital
OS: Android
OS Version: 4.0.4
Location: US-MA-DEMO
Network: Verizon-United States of America
Phone number: +13399278836
Device ID: 991C4AED

Save the image at
PRIVATE:ClrTrip_Images\CalanderForwardImage_for_Android.png


Visual relation direction
Find.text – find the specified text
After that it has to be followed by:
Screen.text or button.click or button.text
Name -type -usage - Value
Visual relation direction – string – constant – <<<above/below>>>
Visual relation inline – <<<Horizontal / Vertical >>>

Which also can be handled with label position and label offset – <<<Above/ below>>>
****Changes made.
11/11/2013 - Updated the Review comment
  1. .iOS – update the text check point with “Search iphone”
Old Code 1
Old Code 2





New code:
Instead of Button image we are using Button Text.
XXX

  1. Old code
Removing the Select from and to city and using VR.









New Code:
  1. Changes done – Send Sms – availability and not available flight. Removed the repository key.




UFT
Old 1
Library file:
Public Function Device_info()
Device("DUT").SetTOProperty "device_id",DataTable("Device",dtLocalSheet)

End Function

Main file:
'##############################################################################################################################################################

'# Script Name                 : MM

'# Test Case Name              : C:\Users\MM\Desktop\MM

'# Limitations                 : it works on Android and iOS

'# Script Description          : Searching Flight Information and Sending flight details through Cloud SMS. 
'# Predcondition               : Searching Flight Information and sending details through Cloud SMS
'                               Installed Application "Cleartrip" from PlayStore and Appstore.
'# Data                           : Android and iOS devices
'# Version Information         : Cleartrip 3.0.2
'# Screen resolution           : We have no resolution constraint.
'# Date Created                : 8/11/2013
'# Author                      : Sundar Technologies India                                                                                                                                                                               '‘#############################################################################################################################################################




For i = 1 To DataTable.LocalSheet.GetRowCount

DataTable.LocalSheet.SetCurrentRow(i)

Device_OS()


'Opening a device

Device("DUT").Open


'Clicking on the Application - Cleartrip

Device("DUT").UserFunctions.OpenApp_Cleartrip


'Selecting the trip

Device("DUT").MButton("trip").SetTOProperty "label",DataTable("Select_Trip",dtLocalSheet)
Device("DUT").MButton("trip").Click

wait 2



'Search Flight - Depart City

Device("DUT").MButton("Depart").Click
Device("DUT").MEdit("city").Set DataTable("Depart_City",dtLocalSheet)

wait 4

Device("DUT").MObject("Departure_City").SetTOProperty "text",DataTable("Depart_City",dtLocalSheet)
Device("DUT").MObject("Departure_City").Click
Device("DUT").Checkpoints.TextCheckpoint DataTable("Depart_City",dtLocalSheet)


'Search Flight - Arrival City

Device("DUT").MButton("round trip").Click
Device("DUT").MEdit("city").Set DataTable("Arrival_City",dtLocalSheet)

wait 4

Device("DUT").MObject("Arrival_City").SetTOProperty "text",DataTable("Arrival_City",dtLocalSheet)
Device("DUT").MObject("Arrival_City").Click 
Device("DUT").Checkpoints.TextCheckpoint DataTable("Arrival_City",dtLocalSheet)


'Selecting Depart Date

Departure_Date=DataTable("DepartOn_Date",dtLocalSheet)
Departure_Month_Year=DataTable("DepartOn_Month_Year",dtLocalSheet)
ReturnOn_Date=DataTable("ReturnOn_Date",dtLocalSheet)
ReturnOn_Month_Year=DataTable("ReturnOn_Month_Year",dtLocalSheet)


if Device("DUT").MObject("return").Find Then

Device("DUT").UserFunctions.Select_DepartDate Departure_Month_Year, Departure_Date
Device("DUT").UserFunctions.Select_ReturnDate ReturnOn_Month_Year, ReturnOn_Date

Else

Device("DUT").UserFunctions.Select_DepartDate Departure_Month_Year, Departure_Date

End If



'Select Class

Device("DUT").MButton("Class").Click
Device("DUT").MButton("Select_Class").SetTOProperty "label", DataTable("Select_Class",dtLocalSheet)
Device("DUT").MButton("Select_Class").Click

If Device("DUT").MButton("Done").Find Then

     Device("DUT").MButton("Done").Click

Else

     Reporter.ReportEvent micDone,"No Done label","Done label is not present"

End If

wait 3

'

'Search Flight
Device("DUT").MObject("flights").Find
Device("DUT").MButton("Search_Flights").Click

wait 4

'

'Sending Flight Details through Cloud SMS

If Device("DUT").MObject("price").Find Then
Device("DUT").UserFunctions.Flights_Available_SMS
Reporter.ReportEvent micPass,"SMS validation","Flight Information Details successfully sent"

Else

Device("DUT").UserFunctions.Flights_UnAvailable_SMS
Reporter.ReportEvent micPass,"SMS validation","Flight Information Details successfully sent"

End If

'

'Going back to Home page

Device("DUT").UserFunctions.BackToHome

'

'Closing the device

Device("DUT").Close

Next


==== The End of UFT ====
***Old 2***
Library file:
Public Function Device_info()
Device("DUT").SetTOProperty "device_id",DataTable("Device",dtLocalSheet)

End Function

'##############################################################################################################################################################

'# Script Name                            :  Final Assignment                                                                                                    #

'# Test Case Name                         :  Name Assignment5, path D:\Assignment5                                                                              #

'# Limitations                            :  Works for ios & android.                                                                                          #

'# Script Description                     :  In Cleartrip mobile app entering from and to as MAA & LON and checking the availability,                         #
'#                                           Finding Flight Information and sending details through Cloud SMS                                                 #
'# Precondition                           :  Installed Application "Cleartrip" from PlayStore and Appstore.                                                   #
'# Data                                      :  Enter the Device id of ios and Android in Global sheet Device column                                             #
'# Version Information                    :  Clear trip (Version  3.0.2)                                                                                       #
'# Screen resolution                      :  We have no resolution constraint.                                                                                #
'# Date Created                           :  10/21/2013                                                                                                        #
'# Author                                 :  Sundar Technologies India                                                                                                #
'‘#############################################################################################################################################################



'Running the Clear trip for searching the flights

Call Cleartrip()



Public Function Cleartrip()

                
        For i = 1 To DataTable.LocalSheet.GetRowCount
            DataTable.LocalSheet.SetCurrentRow(i)
            Device_info()
            
            'Clicking on the Application - Cleartrip
            OS_Information= Device("DUT").GetROProperty("OS")
            If OS_Information="iOS" Then
                Device("DUT").Home
                If  Device("DUT").MButton("Cleartrip").Exist(60) Then
                    Device("DUT").MButton("Cleartrip").Click
                End if
        ''        wait 3
                Reporter.ReportEvent micPass,"OS validation","Script is running for"&OS_Information&"device"
            Else
                Wait 3
                Device("DUT").UserFunctions.LoginUDFAndroid
                Reporter.ReportEvent micPass,"OS validation","Script is running for" &OS_Information& "device"
            End If
            
            'Search Flight - From 
            If  Device("DUT").MButton("Depart").Exist(30)Then
                Device("DUT").MButton("Depart").Click "timeout=25"
            End If
            If Device("DUT").MEdit("city").Exist(60) Then
                Device("DUT").MEdit("city").Set "Chennai","timeout=60"
            End If
            Wait 4
            Device("DUT").MObject("MAA").Click "timeout=40"
            Device("DUT").Checkpoints.TextCheckpoint "MAA"
        
            'Search Flight - To
            If Device("DUT").MButton("round trip").Exist(30) Then
                Device("DUT").MButton("round trip").Click "timeout=20"
            End If
            If Device("DUT").MEdit("city_2").Exist(60) Then
                Device("DUT").MEdit("city_2").Set "London","timeout=60"
            End If
        '    wait 4
            If Device("DUT").MObject("London, GB - All airports").Exist(60) Then
                Device("DUT").MObject("London, GB - All airports").Click "timeout=60"
                Device("DUT").Checkpoints.TextCheckpoint "LON","index=2"
            End If
        '    wait 4
        
        'Search Flight
            OS_Information= Device("DUT").GetROProperty("OS")
            
            If OS_Information="iOS" Then
                If Device("DUT").MButton("Search flights").Exist(60) Then
                    Device("DUT").MButton("Search flights").Click "timeout=60"
                End If
                'wait 3
            Else
                If Device("DUT").MButton("Search flights_2").Exist(10) Then
                    Device("DUT").MButton("Search flights_2").Click "timeout=60"
                End If
                'wait 3
            End if
            
            'Sending Flight Details through Cloud SMS
            val1 = Device("DUT").MEdit("London").GetROProperty("text")
            val = Left(val1,7)
            If LCase(val)="chennai" Then
                Device("DUT").UserFunctions.Send_info_successfull "Flight information"
                Reporter.ReportEvent micPass,"SMS validation","Flight Information Details successfully sent"
            Else
                wait 4
            Device("DUT").UserFunctions.Send_info_unsuccessfull "Flight information"
                Reporter.ReportEvent micPass,"SMS validation","Flight Information Details successfully sent"
                wait 5
            End If
            
            'Going Back to Home page
            If OS_Information="iOS" Then
            ' Back button < inside the app list.
            'Image name is Back_Image 
            Device("DUT").MButton("Back_Image").Click  "timeout=60"
            Device("DUT").Home
            Else
                Device("DUT").PressKey "4*BACK"
            End If
        Next


End Function

==== The End of UFT ====

***Old 3***
Library file:
Public Function Device_info()
Device("DUT").SetTOProperty "device_id",DataTable("Device",dtLocalSheet)

End Function


'##############################################################################################################################################################

'# Script Name                            :  Final Assignment                                                                                                    #

'# Test Case Name                         :  Name Assignment5, path D:\Assignment5                                                                              #

'# Limitations                            :  Works for ios & Android.                                                                                          #

'# Script Description                     :  In Cleartrip mobile app entering from and to as MAA & LON and checking the availability,                         #
'#                                           Finding Flight Information and sending details through Cloud SMS                                                 #
'# Precondition                           :  Installed Application "Cleartrip" from PlayStore and Appstore.                                                   #
'# Data                                      :  Enter the Device id of ios and Android in Global sheet Device column                                             #
'# Version Information                    :  Clear trip (Version  3.0.2)                                                                                       #
'# Screen resolution                      :  We have no resolution constraint.                                                                                #
'# Date Created                           :  10/21/2013                                                                                                        #
'# Author                                 :  Sundar Technologies India                                                                                                #
'‘#############################################################################################################################################################



'Running the Clear trip for searching the flights

Call Cleartrip()




Public Function Cleartrip()

            
            For i = 1 To DataTable.LocalSheet.GetRowCount
            
                DataTable.LocalSheet.SetCurrentRow(i)
            
                Device_info()
            
                Device("DUT").Open
                
            'Clicking on the Application - Cleartrip
                Device("DUT").UserFunctions.LoginToClearTrip DataTable("App_Name",dtLocalSheet)
            
            'Selecting the Trip
                Device("DUT").MButton("one way").SetTOProperty "label",DataTable("Trip_Type",dtLocalSheet)
                Device("DUT").MButton("one way").Click
                
            'Search Flight - From 
                Device("DUT").MButton("Depart").Click
                Device("DUT").MEdit("city").Set DataTable("From_City",dtLocalSheet)
                wait 3
                Device("DUT").MObject("Chennai").SetTOProperty "text",DataTable("From_City",dtLocalSheet)
                Device("DUT").MObject("Chennai").Click
                Device("DUT").Checkpoints.TextCheckpoint DataTable("From_City",dtLocalSheet)
                
            'Search Flight - To
                Device("DUT").MButton("round trip").Click
                Device("DUT").MEdit("city").Set DataTable("To_City",dtLocalSheet)
                wait 3
                Device("DUT").MObject("London").SetTOProperty "text",DataTable("To_City",dtLocalSheet)
                Device("DUT").MObject("London").Click
                Device("DUT").Checkpoints.TextCheckpoint DataTable("To_City",dtLocalSheet)
            
            'Selecting Depart Date
               Device("DUT").UserFunctions.ClrTrip_Selecting_Depart_date DataTable("Depart_Date",dtLocalSheet),"Month_Year",DataTable("Month_Year",dtLocalSheet)
              
            'Clicking the ‘Search Flights’ to search
            OS_Info = Device("DUT").GetROProperty("OS")
            
            If OS_Info ="iOS" Then
                If Device("DUT").MButton("Search flights").Exist(60) Then
                    Device("DUT").MButton("Search flights").Click "timeout=60"
                End If
                'wait 3
            Else
                If Device("DUT").MButton("Search flights_2").Exist(10) Then
                    Device("DUT").MButton("Search flights_2").Click "timeout=60"
                End If
                'wait 3
            End if


            'Sending Flight Details through Cloud SMS
                Price_var=Device("DUT").MButton("price").GetROProperty("label")
                If Price_var ="price" Then
                  Device("DUT").UserFunctions.ClrTrip_SendingInformationAvailability "Flight Information"
                  Reporter.ReportEvent micPass,"SMS validation","Flight Information Details successfully sent"
                Else
                  Device("DUT").UserFunctions.ClrTrip_SendingInformationNotavailable "Flight Information"
                  Reporter.ReportEvent micPass,"SMS validation","Flight Information Details successfully sent"
                End If
                
            'Going back to Home page
                Device("DUT").UserFunctions.ClrTrip_goingbacktoHomepage
                
            'Closing the device
                Device("DUT").Close
                Next
               
   End function

==== The End of UFT ====

1 comment: