Ask a Question

Exception in Keyword testing with Data Base Table variable

SOLVED
bkrishna213
Occasional Contributor

Exception in Keyword testing with Data Base Table variable

Hello,

 

I am trying to compare excel data with desktop application. Passing inputs from my local excel. Created variable in project level and assigned related excel cells.

Test complete is throwing exception when i am passing 000 via excel.

Example: customer id is 00000088 . In the excel the field type is Text. 

Declared as below in test complete. 

bkrishna213_0-1638453679675.png

Can you please help me how to make this test accept text type as input from excel.

14 REPLIES 14
ebarbera
Staff

Hello @bkrishna213 - 

 

What is the step in your test that is throwing the exception? Is it a checkpoint? Please show how it is configured.

 

Thanks, 
Emma

mattb
Staff

Hi,

Could you take a screenshot of the keyword test or code you are running that's failing? 

bkrishna213
Occasional Contributor

The entire test is based on Property check point comparison.

And its a data driven loop keyword test. The comparison is passed for when excel cell data type is integer Ex: 8900000.

I converted to text local excel cell to text to accept 0's. When this cell hit test complete then exception is thrown.

Please check the attachment.

Thank you. 

bkrishna213
Occasional Contributor

Step where entering customer id

bkrishna213_4-1638457693051.png

 

 

Onscreen action for settext. Here CustomerId is the one which I am picking from excel.

Expected is this step need to enter 0000008 in edit field. But once the control comes here exception is thrown.

KeywordTests.Customer_Inquiry_DataLoop.Variables.Cust_inq["CustomerId"]

bkrishna213_1-1638457563554.png

 

Excel is having below columns

bkrishna213_2-1638457563554.png

 

Over the years I've been using TestComplete, I would run into this problem, and others, using Excel as a data source.  I was spending a lot of time trying to compensate for what are just innate properties of Excel itself.  When I switched to using .csv files for my data source, my test development got much easier.

bkrishna213
Occasional Contributor

Thank you very much for the suggestion. I tried with CSV as input file. 

Once i converted my excel to CSV the fields which i formatted are text became normal cells in CSV file. Able to enter in my application but expected result is not different, because of incorrect customer id.

 

Is there anything i can do with the excel ?

I think it will be easier to fix the csv. Can we try one thing? What is the problem with the customer id?
bkrishna213
Occasional Contributor

The customer id is 8 digit. If it is starting with 00 or 000 like 00081111 in csv file it is showing as 81111. First 000's are not accepting in CSV.

Which results entering non customer id in the application.

Expectation is my csv should accept 000's in the customer id and same need to input in application.

Worst case scenario we could import a cell as a variable, and use a script to change it to a String. After that, slice the string and add 000 to the prefix.

I think there should be a better way but that's an option 🙂 

cancel
Showing results for 
Search instead for 
Did you mean: