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.

1 ACCEPTED SOLUTION

Accepted Solutions
bkrishna213
Occasional Contributor

Re: Exception in Keyword testing with Data Base Table variable

Hi,

 

I found the solution finally. The working solution is passing all fields data type as text to testcomplete. 

Will close this thread. Thank you.

View solution in original post

14 REPLIES 14
ebarbera
Staff

Re: Exception in Keyword testing with Data Base Table variable

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

Re: Exception in Keyword testing with Data Base Table variable

Hi,

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

bkrishna213
Occasional Contributor

Re: Exception in Keyword testing with Data Base Table variable

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

Re: Exception in Keyword testing with Data Base Table variable

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

 

Marsha_R
Community Hero

Re: Exception in Keyword testing with Data Base Table variable

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.


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
bkrishna213
Occasional Contributor

Re: Exception in Keyword testing with Data Base Table variable

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 ?

Marsha_R
Community Hero

Re: Exception in Keyword testing with Data Base Table variable

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

Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
bkrishna213
Occasional Contributor

Re: Exception in Keyword testing with Data Base Table variable

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.

mattb
Staff

Re: Exception in Keyword testing with Data Base Table variable

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: