Exception in Keyword testing with Data Base Table variable
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Can you please help me how to make this test accept text type as input from excel.
Solved! Go to Solution.
- Labels:
-
Data-Driven Testing
-
Keyword Tests
-
Test Run
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Could you take a screenshot of the keyword test or code you are running that's failing?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Step where entering customer id
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"]
Excel is having below columns
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 ?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 🙂
