Passing parameters between Tests

6 posts, 0 answers
  1. Reddy
    Reddy avatar
    23 posts
    Member since:
    Jul 2012

    Posted 10 May 2012 Link to this post

    Hi Telerik Team,
          I created multiple tests for each page of a web application. 

    My Test now looks like this
    Navigate to : 'http://policyadmindev/ascendantOne/'
    Check 'ChoicesRadio' to be 'True'
    Click 'BtnContinueButton'
    Connect to pop-up window : 'http://policyadmindev/ascendantOne/AORuntime/AORuntime.aspx?SessionId='
    Execute test 'QuoteAccess'
    Execute test 'GeneralQuoteInfo'
    Execute test 'PolicyInfo'
    Execute test 'ActuarialExclusion_Form'

    Each of the tests "QuoteAccess", "GeneralQuoteInfo", "PolicyInfo", "ActuarialExclusion_Form" are bound to different tables in a database. I need to run one complete iteration for all the steps for a particular policy but currently my test tries to finish all the iterations in "QuoteAccess" before going to the next test. Is there any way i can pass a parameter between these tests and use T-SQL to define the records to use from the database for each iteration?

    Any help is appreciated!!

    Thank you,
    Nithin
  2. Anthony
    Admin
    Anthony avatar
    19 posts

    Posted 11 May 2012 Link to this post

    Hello Nithin,

    The behavior you described is expected when a subtest is bound to its own data source. Here's the easiest way to implement your desired scenario:

    • Remove data binding from each subtest and only bind data to the parent test.
    • Use the T-SQL Join command in the parent test's data bind dialog to merge each table together into one data source (as seen by Test Studio).
    • Set each subtest's InheritParentDataSource Test Property to True.

    Regards,
    Anthony
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  3. Reddy
    Reddy avatar
    23 posts
    Member since:
    Jul 2012

    Posted 14 May 2012 Link to this post

    This is not working in my case because a couple of tables in my database have several records for one policy which would cause multiple records for each policy when i use T-SQL statement. I need the script to create only one policy per record but iterate through the tables with multiple records for that particular policy.
  4. Anthony
    Admin
    Anthony avatar
    19 posts

    Posted 14 May 2012 Link to this post

    Hello Nithin,

    The work-around in my previous response is the best alternative we can offer. Test Studio is designed to execute every iteration of a data bound Test as Step before advancing to the next step.

    Greetings,
    Anthony
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  5. Sith
    Sith avatar
    1 posts
    Member since:
    Jun 2012

    Posted 13 Jan 2013 Link to this post

    Hi Anthony,

    I have a slightly different question but similar to Nithin and thought I just added to the thread.
    I am more than happy to start a new support ticket.

    I have a parent test (Fill it) with the following scenario:

    Execute test Navigate to XYZ
    Click 'AddMoreMenuButton'
    Execute test FillTheForm
    Wait for Exists 'AddMoreMenuButton'
    Verify 'TextContent' 'Contains' 'my new menu' on 'AutoMenu1TableCell' - DataDriven:[$(addedMenuName)]

    Within the FillTheForm test, I have an Extract to get the Input into the DataBindVariable: $(addedMenuName). Everything goes well until the run gets to the Verify step. It fails because it cannot find the value of the variable of $(addedMenuName) instead it is using the cache record and finds an older value which I recorded while creating the test.

    Also, if I use the following command
    Execute test "ClickOnEditLink"

    where the Element is setup to use the variable $(addedMenuName) to find the row in order to click on the link.  It too cannot find the correct row/cell and so ended using the cache value.
    Here's the message within the Log:
    'Pass': 1. Click 'cphTypeEdithyerlink9Link'
    element was found by backup search only! We recommend editing the element to correct the primary find express.
    Primary Find Expression: tagName=~form, id=form1, |, id=content,|,id=^cph_type_row,
    textContent=^$(addedMenuName), |,tagName=a, id=^cph_typeRepeater_editHyperlink_,InnertText=Edit
    Element was found by backup search: xpath=/html[1]/body[1]/form[1]/div[3]/div[2]/table[1]/tbody[1]/tr[11]/td[5]/a[4]


    I've read the following pages and others but still have not found a solution:

    http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/elements-pane-overview/find-element.aspx
    http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/knowledge-base/data-driven-testing/pass-a-variable.aspx


    What am I doing wrong?

    thank you,
    Sith'
  6. Plamen
    Admin
    Plamen avatar
    8 posts

    Posted 17 Jan 2013 Link to this post

    Hello Sith,

    I apologize for the delay in getting back to you on this. I was able to replicate the exact same scenario that you are describing and unfortunately I hit the same issue. The problem is that Test Studio is not able to see the value of the extracted variable when that variable is used in a Data Driven Find Expression(as a Find clause). I filed a bug report on this. You can track the progress of the PITS Issue here: Public URL.

    I have updated your Telerik points accordingly for being the first to report this issue.

    In the meantime as workaround you can create the Data Driven Find Expression in code. Here's an article demonstrating how to do that.  

    All the best,
    Plamen
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
Back to Top