Forum Discussion

vijay_bhaskar's avatar
vijay_bhaskar
Occasional Contributor
9 years ago

I tried to read ip (10.10.10.10) from the CSV file the value displays incorrect (10.101)

I am trying to automate the Desktop application reading the data from CSV file in which there i am trying to fetch the ip from CSV file but the value is returned as below mentioned.

Input Value: 10.10.10.10

Expected Value: 10.10.10.10

Actual Value Fetched: 10.101

when I tried with the below workaround solution it works fine.,

Input Value: a10.10.10.10

Actual Value Fetched: a10.10.10.10

I would like to know if there is a way to fetch the ip value from CSV without appending the string.

Regards

Vijay Bhaskar U

 

 

10 Replies

  • Are you creating the CSV using Excel?

     

    I seem to recall Excel cell formatting affecting how values are read in by external sources such as TestComplete.

     

    Try formatting the cells as text before saving the CSV. Adding the "a" and it coming out right does suggest that the added "a" causes the content to be treated as text so passed through correctly.

     

    (Or try creating it in notepad instead)

    • vijay_bhaskar's avatar
      vijay_bhaskar
      Occasional Contributor

      Tool is generating the CSV file, which is used as the input source for the Automation.  I will be using those values as the input to the application which is read from CSV using DDT CSV Driver.

      • Colin_McCrae's avatar
        Colin_McCrae
        Community Hero

        What tool?

         

        (You really need to give specific information if you want useful answers!)

         

        And try manually creating a CSV yourself (using notepad) and feed it that and see what happens. At least then that will tell you if the problem is the formatting of the CSV by "the tool" (whatever it is) or TestComplete when it reads it in.

         

        All my tests (scripted) are data driven using data read in from an Excel spreadsheet (I don't use the DDT object, I have my own IDE extension modules which effectively form a test framework). I just tried feeding a textbox 10.10.10.10 from my Excel input sheet and it worked perfectly. The Excel cell format is "General" but the 10.10.10.10 being preceeded by "P:" (part of my framework, the "P:" indicates a parameter. It's not part of the actual data it feeds the TextBox) would likely cause Excel to treat it as Text and so not try and apply any crazy number formatting to it (which it would without the "P:").