How to write validation results to an excel file?

Ask general questions here.
Shuai
Posts: 6
Joined: Fri Jun 19, 2015 8:36 pm
Location: New York, United States

How to write validation results to an excel file?

Post by Shuai » Fri Jun 19, 2015 9:30 pm

Hi all,

In the user code, how do you write validation results to an excel file? For example, I have multiple radio buttons, I want to make an excel file (to record if each button is selected) like this:

button1 button2 button3
true true true

And later on I want to pull from this file and validate new automations/recordings against this file. How would I do that?

Thank you!

Starlord
Posts: 10
Joined: Thu May 14, 2015 4:51 pm

Re: How to write validation results to an excel file?

Post by Starlord » Tue Jun 23, 2015 5:57 pm

Hi Shuai,

I have done something similar to this in my test case. You should be able to use the .NET functions for excel by referencing Microsoft.Office.Interop.Excel in your project, then you can write out to the excel file. There is some useful details in this post:

http://www.ranorex.com/forum/my-excel-f ... t3265.html

For your validation you should be able to use the same excel file as a data source. Ranorex is able to handle Excel connections via the studio data source functionality or via code using the excel connector class. The blog article on “Data driven test automation with Excel” gives a great description on how this is implemented.

http://www.ranorex.com/blog/data-driven ... with-excel

Just so you know Microsoft.Office.Interop.Excel is available under the GAC if Microsoft Excel is installed in the local machine.

Hope this helps with what you are trying to do.
Cheers!!

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

Re: App get crashed while tap on element in iOS Instrumented app

Post by odklizec » Tue Jun 23, 2015 6:22 pm

Hi,

I'm using Ranorex CSV connector to write/read CSV reference files, which I'm then using for setting and validating GUI. The advantage of using CSV is that it does not require Excel to be installed on target machine and the CSV files are easy to edit with any text editor.

There are many posts discussing the usage of CSV data connectors. Check for example these two posts...
http://www.ranorex.com/forum/test-data- ... html#p9510
http://www.ranorex.com/forum/csv-file-r ... tml#p16892
You can find some more via "Search".
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

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: How to write validation results to an excel file?

Post by krstcs » Tue Jun 23, 2015 6:40 pm

I would agree with Pavel, if you need to write data to a flat file, you should check out the CSV file as it can be read/written by Excel and doesn't require you to install Excel/Office on your test systems. It also is much easier to manipulate because you don't need to use the Office.Interop assemblies and is just a plain text file.



Take it for what it's costing you, but, in my opinion, Excel is the worst thing to happen to testing, ever. Excel is for accountants and should be left there. Testers should learn to use databases, and barring that, use flat text files. And, reporting should be done in a real report format or on a web page, not Excel. But, as I said, it's my opinion... :D
Shortcuts usually aren't...

Shuai
Posts: 6
Joined: Fri Jun 19, 2015 8:36 pm
Location: New York, United States

Re: How to write validation results to an excel file?

Post by Shuai » Mon Jul 20, 2015 4:36 pm

Thank you everyone! I have found a way around to solve this! :)