Forum Discussion

gurvin_net's avatar
gurvin_net
Occasional Contributor
15 years ago

Type Mismatch Error in KeywordTest when Excel sheet column is blank

I created a KeywordTest and made a data driven loop with Excel Worksheet in TC8.

The purpose of test is to fill customer registration form. The sheet has 5 rows of data with columns like FNAME, LNAME, MID, ADDRESS etc..Now test fails when one of the column is blank and I get "type mismatch" error.



How can this be resolved.
  • gurvin_net's avatar
    gurvin_net
    Occasional Contributor
    I saw one of the post about using aqObject.GetVarType validation before creating my post. The problem is that my form has 50+  fields. 95% of the fields are not mandatory. I have to test both scenario blank and not blank and make sure database stores correct values.



    If I am not wrong then your recommendation will involve putting 50 verification for 50 columns. That is not efficient. I have to test 20-30 forms like this one.

  • Hi,





    You get values from Excel in a loop, right? Just insert this validation right after the line which reads the current value on the current iteration.

    There's no other way to check whether values are empty.


  • gurvin_net's avatar
    gurvin_net
    Occasional Contributor
    Hi,



    I am sorry, not clear. I used KeywordTest - data driven loop to read values from excel sheet. Pls show me how to use validation code ( aqObject.GetVarType ) here.

     

    Thanks

  • Hi,





    You need to insert an 'If... Then' operation to your data-driven loop. In the operation's condition specify the following:

    Value1: Table Data - select your DB Table variable here.

    Condition: not equal to

    Value2: null





    This will check whether the current value is empty.


  • kara's avatar
    kara
    Occasional Contributor
    This was working fine for me in the last release. I just needed to put a ' in the excel spreadsheet for any empty fields. Now, I've just upgraded to V. 9.30.3373.7 and I get a type mismatch for every empty field whether there is an apostrophe or not. This is very annoying. I have to test for fields not getting entered by the user and I can't.