Excel Data Driven Loop on Runtime -vb.net

10 posts, 1 answers
  1. Jonathan
    Jonathan avatar
    23 posts
    Member since:
    Jan 2012

    Posted 13 Jan 2012 Link to this post

    I'm currently evaluating telerik for our QA team.  I have created a main script that calls several little scripts that I have recorded such as (logIn, clientInfoForm, involvedParties, and MedicalCodes).  For clientInfoForm and involvedParties, I am binding information from excel since each field only requires a distinct value.  However, I want to be able to execute the code in the MedicalCodes script for every medical code that exists in the excel spreadsheet for this case.  Without looping through the other scripts within the main script.  

    I want to do something like the following for the MedicalCodes script:

    Pages.Page.MedicalLink.Click

    dim excelConnectionString

    'This  will need to read how many rows exists for a particular column.
    'One each iteration execute the following commands

    While Not rows.eof 

    Pages.Page.Textbox1.Entertext 'From excel
    Pages.Page.AddButton.Click

    rows.MoveNext

    Wend



    'Thanks
  2. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 13 Jan 2012 Link to this post

    Hi Jonathan,

    Please try the approach described in this KB article.

    Kind regards,
    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. Jonathan
    Jonathan avatar
    23 posts
    Member since:
    Jan 2012

    Posted 27 Jan 2012 Link to this post

    This was very helpful and I was able to automate this test case. I am very impressed with this feature.   One other problem I'm running to is that for each test case, I need a couple different excel spreadsheets that business users will fill out.  We have hundreds of test cases!   I don't want to load hundreds of data sources to the same project and thought of creating different projects for each test case.  However, I don't see the ability to reference scripts from other projects in "Test as Step" and I can't reference tests in other projects when trying to create a test list.  Am I forced to keep everything in a single project?

    Thanks,

    Jonathan
  4. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 31 Jan 2012 Link to this post

    Hi Jonathan,

    Yes I am sorry that is a limitation of Test Studio. Test Lists and Test-as-step can only reference tests from the currently open test project. It is not capable of reference other tests contained in other projects.

    Generally speaking a well designed test plan (including well defined test cases) should only need a few data sources, even when there are many hundreds of test cases. A single data driven test can run through hundreds of rows of data without any problem.

    The key is to try to not do too much within a single test. For example, it is considered a bad design to create one test case that will test both good/successful login's as well as incorrect login's. You need to add IF ELSE to your test because you are testing to different scenarios. Plus your test results become confusing. You'll look and see row 15 failed but you have to stop and think what was row 15 testing.

    Instead create one test for each unique scenario and data drive both with different data sources/tables. Then when the test fails you instantly know which feature is not working correctly simply by the name of the test.

    If you need further assistance with this perhaps we should discuss your specific testing problem via GoToMeeting.

    Greetings,
    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
  5. Jonathan
    Jonathan avatar
    23 posts
    Member since:
    Jan 2012

    Posted 02 Feb 2012 Link to this post

    Cody,

    A GoTo Meeting would be perfect. I'm assuming you can get my contact info from here.   

    Thanks,

    Jonathan
  6. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 02 Feb 2012 Link to this post

    Hello,

    Would Monday at 11am Central Time work for you? Assuming it will here's a meeting invite:

    1.  Please join my meeting.

    https://www2.gotomeeting.com/join/812621786

    2.  Use your microphone and speakers (VoIP) - a headset is recommended.  Or, call in using your telephone.

    Dial +1 (213) 289-0016

    Access Code: 812-621-786

    Audio PIN: Shown after joining the meeting

    Meeting ID: 812-621-786

    GoToMeeting®

    Online Meetings Made Easy™


    Regards,
    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
  7. Jonathan
    Jonathan avatar
    23 posts
    Member since:
    Jan 2012

    Posted 03 Feb 2012 Link to this post

    That time works perfectly.

    Thanks,

    Jonathan
  8. Answer
    Cody
    Admin
    Cody avatar
    3354 posts

    Posted 06 Feb 2012 Link to this post

    Hello,

    I enjoyed working with you in our GTM today. Here's a link describing the "swap files" approached I told you about. It doesn't have any code sample however.
    http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/knowledge-base/data-driven-testing/dynamic-data-binding.aspx 

    Here is the MSDN documentation for the .NET copy file function:
    http://msdn.microsoft.com/en-us/library/9706cfs5.aspx 

    Kind regards,
    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
  9. Jonathan
    Jonathan avatar
    23 posts
    Member since:
    Jan 2012

    Posted 07 Feb 2012 Link to this post

    Cory,

    Thanks for you help once again.  I am very impressed with the forum support staff and the level of service that I have received.  I took your advice and went with option 1 from your provided link.

    In case anyone else has this issue and was lost like I was, these are the steps that I took to get this done.  In order to get this working on my machine, I had to add the following reference into telerik:  mscorlib.dll

    I then created a new script and had to add the following to the top of the file:

    Imports

     

     

    System.IO

     


    I then added the code provided in this forum from the msdn site and received the following error when trying to execute:

    (BC30561) 'Path' is ambiguous, imported from the namespaces or types 'ArtOfTest.WebAii.Silverlight.UI, System.IO'.


    In order to get around this error, I commented out the following line (I don't need Silverlight)  that is default in all scripts:

    'Imports ArtOfTest.WebAii.Silverlight.UI

    And it worked!!!


    Thanks Again,

    Jonathan
  10. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 07 Feb 2012 Link to this post

    Hello Jonathan,

    Sounds like you did it right! We aim to please our paying customers as well (or soon to be). Looking at your account it appears your trial is about to expire. Are you ready to commit?

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