Forum Discussion

Andrew_Robinson's avatar
Andrew_Robinson
Occasional Contributor
10 years ago

Verifying data from a form that has change slightly


Hello, 



I have been using Test Complete for about 7 days so please go easy on me.



I am using a keyword test and I have a form that has a text box where a telephone number is input. Now the thing is, I can have a data loop input(from excel table) "7045675678" and the text box will accept it. The problem is that the textbox will auto format the number to: 704-567-5678. I cannot change this auto formatting. 



Thus, when I use a property checkpoint to compair it against the excel file it fails because 704-567-5678 does not equal 7045675678(which is stored in the excel file)



I am a little shaky on using actual "code" so if that is required please insturct me on how to implement it. 



Thanks! 


4 Replies

  • murugans1011's avatar
    murugans1011
    Regular Contributor
    hi u can try by converitng excel value to appropriate format and unsing proprty checkpoint to compre object property



    [VBScript]



    intno ="7045675678"



    FinalNo=Left(Intno,3)&"-"&Mid(intno,4,3)&"-"&Right(Intno,4)



    Call aqObject.CheckProperty(Object, "Property", cmpEqual, FinalNo, False)





    or else store object property value to variable compre with excel value





    tmpno="704-567-5678"

    final=Replace(tmpNo,"-","")
  • Would it not be easier to simply put the data on the excel sheet into the same format as it will be on the website?



    So change the cell type in the excel table to text (so it won't reformat it) and then enter it on there with all the dash's in place. Then when they are compared, they will match.
  • Andrew_Robinson's avatar
    Andrew_Robinson
    Occasional Contributor
    Thanks I will try that in a bit, sounds like it might work. Sometimes I overthink these things, seems I was trying to solve it in TestComplete rather than excel.