Error when comparing larger

Ask general questions here.
diogogmaio
Posts: 33
Joined: Thu May 19, 2016 4:52 pm

Error when comparing larger

Post by diogogmaio » Fri Jul 01, 2016 2:10 pm

Hello
I am facing an major issue when comparing to excel files.
When the excel files are basic...few columns and rows...every comparison works.
When the files are huge like 2500 columns and rows i got the following error.

Code: Select all

/// <summary>
		/// method to compare two excel files
		/// </summary>
		/// <param name="refFile"></param>
		/// <param name="cmpFile"></param>
		public static void CompareExcelFiles(string refFile, string cmpFile)
		{
			//validate path to configuration file
			ExcelFileExists(refFile);
			//create CSV data connector
			string refConnector = "ExcelConnector";

			ExcelFileExists(cmpFile);
			//create CSV data connector
			string cmpConnector = "ExcelConnector";

			//get data from ref. Excel
			Ranorex.Core.Data.ExcelDataConnector refExcelConnector = new Ranorex.Core.Data.ExcelDataConnector(refConnector,@refFile,"Book Value","",System.Windows.Forms.CheckState.Unchecked);
			Ranorex.Core.Data.ColumnCollection refExcelColumns = new Ranorex.Core.Data.ColumnCollection();
			Ranorex.Core.Data.RowCollection refExcelRows = new Ranorex.Core.Data.RowCollection(refExcelColumns);
			
			//load Excel connector
			refExcelConnector.LoadData(out refExcelColumns, out refExcelRows);

			//get data from cmp. Excel
			Ranorex.Core.Data.ExcelDataConnector cmpExcelConnector = new Ranorex.Core.Data.ExcelDataConnector(cmpConnector,@cmpFile,"Book Value","",System.Windows.Forms.CheckState.Unchecked);
			Ranorex.Core.Data.ColumnCollection cmpExcelColumns = new Ranorex.Core.Data.ColumnCollection();
			Ranorex.Core.Data.RowCollection cmpExcelRows = new Ranorex.Core.Data.RowCollection(cmpExcelColumns);
			
			//load Excel connector
			cmpExcelConnector.LoadData(out cmpExcelColumns, out cmpExcelRows);
How I am not able to retrieve the data from the Excel files? Is this because the files are too big? Or the format of the columns and rows?

Thanks for the help
Attachments
error_ranorex.jpg
Error in Ranorex
error_ranorex.jpg (267.45 KiB) Viewed 547 times

User avatar
RobinHood42
Posts: 239
Joined: Fri Jan 09, 2015 3:24 pm

Re: Error when comparing larger

Post by RobinHood42 » Tue Jul 05, 2016 11:25 am

Hi diogogmaio,

May I ask you why you are using the Ranorex Dataconnector to compare the excel files? As far as I know, the Ranorex Excelconnector is not intendet to compare two files. In my opinion it would be much easier using the .NET functionality as described in the following msdn post.

Cheers,
Robin

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3930
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Error when comparing larger

Post by odklizec » Tue Jul 05, 2016 12:38 pm

Well, that will be my fault ;) I've suggested using Ranorex data connector for simple csv/excel file comparison. I'm using it quite successfully with relative simple csv files. The advantage is that there is not required an additional csv/excel library and complex custom code. Just couple of loops ;) However, I agree with Robin that for proper comparison of large/complicated excel files, there should be used a dedicated solution. I'm not aware of any data connector limitation related to number of rows or columns. But Excel file with 2500 columns sounds quite crazy and not something I would ever consider to use ;)
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

diogogmaio
Posts: 33
Joined: Thu May 19, 2016 4:52 pm

Re: Error when comparing larger

Post by diogogmaio » Tue Jul 05, 2016 2:24 pm

I understand.

I have one more doubt.

http://www.ranorex.com/Documentation/Ra ... tNames.htm

I cannot put this to work in my code.

I want to load the file...then retrieve the worksheet names. How can I do this?

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Error when comparing larger

Post by Support Team » Thu Jul 07, 2016 12:14 pm

Hello diogogmaio,

I've seen that your question was already answered in a different topic.
Please do not create multiple topics for the same question.

Creating duplicate requests do not speed up the answering process, but rather creates an overhead.
 
Thank you for your understanding.

Sincerely,
Markus (S)
.
Image