This is a migrated thread and some comments may be shown as answers.

How we can validate data on Export to PDF,Excel,Word and XML

12 Answers 228 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Deepak
Top achievements
Rank 1
Deepak asked on 28 Jun 2012, 11:57 AM
  Hi,

We have an application where we need to verify application data with Export to PDF,Excel,Word and XML.
For Ex. In your application there are several records of employees of your organization which displays in the Html Table. You need to add one record and after that need to verify this all data (Old employees data+Newly added) on clicking Export to pdf, pdf opens and you need to verify the pdf data with application Html data

Thanks,
Deepak

12 Answers, 1 is accepted

Sort by
0
Anthony
Telerik team
answered on 28 Jun 2012, 02:50 PM
Hello Deepak,

Test Studio cannot connect to nor automate against a browser instance that directly loads a PDF file. This is because it does not have a DOM like a traditional web page.

You can write custom code to open and read an Excel, Word, or XML file on disk, however there is no built-in functionality in Test Studio nor the Framework to handle this.

Regards,
Anthony
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Max
Top achievements
Rank 1
answered on 11 Jul 2012, 11:01 AM

I have a code block that will do something like this, for a test that I am writing.

Currently though, I'm just echoing out file exists/doesn't exist to the console.

How can I add the output of my file check to Test Studio standard logging please? Where in the API is this?

0
Anthony
Telerik team
answered on 11 Jul 2012, 02:58 PM
Hello Max,

You can use Log.WriteLine to write a string to the log. You can use code like this to capture your output as a string to pass into Log.WriteLine.

All the best,
Anthony
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Max
Top achievements
Rank 1
answered on 11 Jul 2012, 03:28 PM
Thanks. Where exactly does Write.Log sit in the API?
0
Anthony
Telerik team
answered on 11 Jul 2012, 03:50 PM
Hello Max,

I linked to the wrong page. See here for the Log.WriteLine method and here for all the Log members.

Regards,
Anthony
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Max
Top achievements
Rank 1
answered on 11 Jul 2012, 04:00 PM
Excellent, thanks.
0
Max
Top achievements
Rank 1
answered on 12 Jul 2012, 08:59 AM
Actually - regarding capturing the output as a string. I'm a little confused here? Is the strategy you suggest to do my check in a console, then capture that with Log.Writeline? If so, can't I directly log from the check without the console?
0
Anthony
Telerik team
answered on 12 Jul 2012, 02:58 PM
Hello Max,

Certainly you can directly log the result of your file check. We simply suggested the more advanced console output approach in case you required it.

Kind regards,
Anthony
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Max
Top achievements
Rank 1
answered on 13 Jul 2012, 12:30 PM

I've tried this in several formats now, but the test just stops at that point.

Does the file checking need to be in some form of spawned process?

0
Anthony
Telerik team
answered on 13 Jul 2012, 01:56 PM
Hello Max,

We won't be able to provide in-depth troubleshooting for non-Telerik Testing Framework code. The Throw New Exception section in this article has a basic code sample that checks for the existence of a file. You can easily replace the code in the ELSE portion with another Log.WriteLine.

All the best,
Anthony
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Max
Top achievements
Rank 1
answered on 13 Jul 2012, 02:19 PM
Thanks - I'm not actually looking for the code. I just wanted to know if the execution flow of TestStudio requires a new process for the step, or not?
0
Anthony
Telerik team
answered on 13 Jul 2012, 06:58 PM
Hello Max,

Are you using a coded step in Test Studio or a coded unit test using the Telerik Testing Framework (this is the Framework forum)? There really isn't the concept of a "step" in a Framework test, just lines of code.

The bottom line is we'll need to see the code you're using to analyze the implementation you've chosen and to diagnose why it isn't working.

All the best,
Anthony
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
General Discussions
Asked by
Deepak
Top achievements
Rank 1
Answers by
Anthony
Telerik team
Max
Top achievements
Rank 1
Share this question
or