I’m trying to compare an object text value using GetText to an item in the datatable, but it’s failing the comparison.
I’ve even put in message boxes that display both values, and although the values are the same, the comparison fails.
Script:
‘parameters
site_url = “http://199.189.178.11/OnlineServicing/Welcome.aspx#Login”
input_pnum = Cstr(Datatable.Value(“PolicyNumber”))
‘Open device browser using datatable option
Application(“OLS Mobile”).Launch Datatable.Value(“Browser”),site_url
‘Enter username and password – RightClick makes the keyboard go away
Application(“OLS Mobile”).View(“Login”).Object(“label_UserID”).Object(“textbox_UserID”).Type Datatable.Value(“Username”)
Application(“OLS Mobile”).View(“Login”).Object(“label_UserID”).RightClick
Application(“OLS Mobile”).View(“Login”).Object(“label_Password:”).Object(“textbox_Password”).Type Datatable.Value(“Password”)
Application(“OLS Mobile”).View(“Login”).Object(“label_Password:”).RightClick
Application(“OLS Mobile”).View(“Login”).Object(“button_Log In”).Click
‘Click Menu button and view Policy Info
Application(“OLS Mobile”).View(“Billing”).Object(“button_Menu”).Click
Application(“OLS Mobile”).View(“Menu”).Object(“link_PolicyInfo”).Click
Application(“OLS Mobile”).CustomReport true, “Policy Info Loaded”,”Test Passed”
policynum = Application(“OLS Mobile”).View(“HomeownerPolicyInfo”).Object(“txt_PolicyNumber”).GetText
Application(“OLS Mobile”).CustomReport true, “Policy Number”,policynum
Application(“OLS Mobile”).View(“HomeownerPolicyInfo”).Object(“link_ClosePolicyInfo”).Click
If policynum = input_pnum then
msgbox “success”
else
msgbox “failed”
end If
msgbox “Policy# ” + policynum
msgbox “Input Table# ” + input_pnum