cancel
Showing results for 
Search instead for 
Did you mean: 

Input data has been trancated while taking from csv

Super Contributor

Input data has been trancated while taking from csv

Hi all,



In our application, we need to be enter at least 16 digit number in a Textbox (Edit Box), I have took the input from csv file, when I put this input in our application, TestComplete gives me a warning message  "The text specified in the edit box has been truncated, since it was too long." but when I put same 16 digit number as hardcoded it will be accept.  what's the wrong with csv, please help.



Thanks

Ravik
12 REPLIES 12
Contributor

RE: Input data has been trancated while taking from csv

Hi Ravik.



Check the actual length of what TC tries to input into field property with logging like this:



Log.Message( YourValue.length )

or

Log.Message( Len( YourValue ) ) if you use VBS.



It's good idea to log value itself as well.



Super Contributor

RE: Input data has been trancated while taking from csv

HI Andrey,



I want to enter at least (min 16 digit ) 16 digit number into a Textbox and I want to get data from csv. actually what happen- When I put 16 digit number like - SetText("1234567890123456") it will be accept and execute by TestComplete but when I move for data drven testing and try to get same number from csv file, Then it is trancate and gives above mention Error
Contributor

RE: Input data has been trancated while taking from csv

Hi Ravik.



Can you attach your actual csv file (replace data with some neutral set of digits in case if you don't want actual data to be exposed) which causes error?



Regards,

Andrey
Super Contributor

RE: Input data has been trancated while taking from csv

Hi



I am attaching the csv file, which is I have use for Data Driven Testing, While I am reading data from Attached csv file it's giving me error (mention on above post).



Not able to attached csv and txt file hence I am putting data here,



CurrentNumber, NewNumber

3466011412316687, 1234567890123456

3466011412316687, 1234567890123456
Highlighted
Frequent Contributor

RE: Input data has been trancated while taking from csv

The data in the CSV file is comma-separated so the extra space between the numbers will be counted as an extra character.



You can remove the extra spaces from the source data or by using aqString.Trim in your script

http://support.smartbear.com/viewarticle/28278
Super Contributor

RE: Input data has been trancated while taking from csv

Hi Paul,



Actually There are no Space between column in actual csv, I have put space for easily understand in post . our actula data is like that. (do You know why data it trancated while reading from csv)



CurrentNumber,NewNumber

3466011412316687,1234567890123456

3466011412316687,1234567890123456

Community Manager

RE: Input data has been trancated while taking from csv


Hi Ravi,


 


Are you using the Schema.ini file to set the structure of the CSV file? Make sure that the FixedLength value has the needed length. Refer to this MSDN article for more information.


 

---------
Tanya Gorbunova
SmartBear Community Manager

Join the annual community event and share your stories to win gifts
Wintertainment2019
Super Contributor

RE: Input data has been trancated while taking from csv

Sorry Tanya,



I am not understand "Make sure that the FixedLength value has the needed length."  What I did, I have Open a Notepad and Enter Data and Save it with csv extention



Like - Test.csv. Now I want to get the number from the Test.csv file. (Our Number is 16 Digit number) TC get the Number from csv but it will be trancated, I want to know Whey it's trancate ?



What is the alternavite, How we can get atleast 16 digit number from csv file.
Contributor

RE: Input data has been trancated while taking from csv


Hi Ravik.


 


Alternative is Excel spreadsheet. It works the same way as csv (title row may work as structure description). I'd suggest using Text type of data (cell format) for your digital sequences.


 


If you continue getting this error (truncating of data) try to debug your code.


 


1. Create local KDT variable and assign hardcoded value to it.


2. Pass variable into text property.


3. if there are no errors in this code, assign variable with the value taken from csv file.


4. if you get error, log the value from variable, check it's actual length and text itself.


 


Sorry I can not suggest something better, I tried to play with your scv, changed encoding (used ANSI vs Unicode): everything works as expected, TC understands text encodings properly (I use v9.31).


 


One of the reasons why I asked to attach csv file (not to post it into forum message): may be something wrong with actual data stored in that file. If forum does not allow you to attach csv, you may attach zipped csv file.