Writing to Excel

6 posts, 0 answers
  1. Kumar
    Kumar avatar
    12 posts
    Member since:
    Sep 2010

    Posted 20 Oct 2010 Link to this post

    Hi,

    How can i write my result to excel sheet?.

    Regards
    Kumar
  2. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 25 Oct 2010 Link to this post

    Hi Kumar,

    Are you asking how to write code that writes to an Excel spreadsheet? Here's one link of many from a Google search:

    http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/ef11a193-54f3-407b-9374-9f5770fd9fd7

    Are you asking how to log the pass/fail of a test? This must be done in the [TestCleanup()] section. You can refer to the TestContext.CurrentTestOutcome property to determine the results of a test, then write it to your Excel file.

            [TestCleanup()]
    All the best,
    Cody
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Swaroop
    Swaroop avatar
    3 posts
    Member since:
    May 2011

    Posted 28 Jun 2011 Link to this post

    HI COdy,
    How can I write the value of an extracted variable into an excel sheet using coded step?
    I am capturing the value from the application dynamically while executing the steps using "Extraction" option

    Thanks,
    Swar.
  4. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 29 Jun 2011 Link to this post

    Hello Swaroop,

    You can fetch the value of an extracted variable with code like this:

    string newReq = (string)GetExtractedValue("varname");

    From there it's just a matter of storing the value into your Excel file (or any other data file) using code like shown in the link of my previous post.

    Greetings,
    Cody
    the Telerik team
    Register today for a live 'What's New in Test Studio R1 2011 SP2' event on Tuesday, July 19 at 2pm EST!

    Have you looked at the new Online User Guide for Telerik Test Studio?
  5. Swaroop
    Swaroop avatar
    3 posts
    Member since:
    May 2011

    Posted 01 Jul 2011 Link to this post

    Thanks Cody.
    I have tried the code mentioned in the previous post. But I am getting as I am not using the correct NameSpace.
    Could you please let me me know which type of Namespace to be used to make the code work?

  6. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 01 Jul 2011 Link to this post

    Hi Swaroop,

    The GetExtractedValue function is contained in BaseWebAiiTest, which our standard code behind files use as a base like this:

        public class WebAiiTest1_7 : BaseWebAiiTest
        {
     
            [CodedStep("MyCustom Step Description")]
            public void MyCustomStep()
            {
    <rest of code snipped>

    Are you using our standard code behind model? You posted this in our Telerik Testing Framework forum. That product doesn't include BaseWebAiiTest (nor does it reference coded steps from Test Studio).

    It might help if you sent me your entire test project for me to analyze. Put the entire folder into a .zip and attach that file. You may want to open up a new support ticket to keep it private between you and my support team.

    Regards,
    Cody
    the Telerik team
    Register today for a live 'What's New in Test Studio R1 2011 SP2' event on Tuesday, July 19 at 2pm EST!

    Have you looked at the new Online User Guide for Telerik Test Studio?
Back to Top