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

13 posts, 0 answers
  1. Deepak
    Deepak avatar
    17 posts
    Member since:
    Jun 2012

    Posted 28 Jun 2012 Link to this post

      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
  2. Anthony
    Admin
    Anthony avatar
    19 posts

    Posted 28 Jun 2012 Link to this post

    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
  3. Max
    Max avatar
    9 posts
    Member since:
    Jul 2012

    Posted 11 Jul 2012 Link to this post

    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?

  4. Anthony
    Admin
    Anthony avatar
    19 posts

    Posted 11 Jul 2012 Link to this post

    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
  5. Max
    Max avatar
    9 posts
    Member since:
    Jul 2012

    Posted 11 Jul 2012 Link to this post

    Thanks. Where exactly does Write.Log sit in the API?
  6. Anthony
    Admin
    Anthony avatar
    19 posts

    Posted 11 Jul 2012 Link to this post

    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
  7. Max
    Max avatar
    9 posts
    Member since:
    Jul 2012

    Posted 11 Jul 2012 Link to this post

    Excellent, thanks.
  8. Max
    Max avatar
    9 posts
    Member since:
    Jul 2012

    Posted 12 Jul 2012 Link to this post

    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?
  9. Anthony
    Admin
    Anthony avatar
    19 posts

    Posted 12 Jul 2012 Link to this post

    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
  10. Max
    Max avatar
    9 posts
    Member since:
    Jul 2012

    Posted 13 Jul 2012 Link to this post

    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?

  11. Anthony
    Admin
    Anthony avatar
    19 posts

    Posted 13 Jul 2012 Link to this post

    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
  12. Max
    Max avatar
    9 posts
    Member since:
    Jul 2012

    Posted 13 Jul 2012 Link to this post

    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?
  13. Anthony
    Admin
    Anthony avatar
    19 posts

    Posted 13 Jul 2012 Link to this post

    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
Back to Top