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

Can I add data parameters

2 Answers 71 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kimberley
Top achievements
Rank 1
Kimberley asked on 03 Jun 2011, 07:22 PM
Hi,

I am currently evaluating the WebUI Test Tool and I have several questions:

My main need is to find a tool that easily allows me to execute my test suite against 8 browser/version combinations, specifically: IE 7, 8 & 9, FF 3.6 & 4, Safari 4.0 & 5.0 and the latest version of Chrome, without maintaining 8 different versions of scripts.  When I execute the test once, say in IE 7, I will need to execute the same steps in the next version, IE 8, but with different data values.

So for instance in my application I will execute the following steps:

IE 7

1. Create a new publisher: LVG Publishing House
2. Create a new publication: Sport's Illustrated
3. Create a new edition: Sport's Illustrated , July 2011

Once I create this publisher/publication/edition combinaiton, these values are stored in our database and cannot be reused.  If they are resused the script would fail encounter several validation errors.  I need to be able to run these same steps but with different values, say LVG Publishing House 02,  Is there a way to easily do this without creating 8 unique versions of basically the same steps.

Can I add parameters of some type that can incerment my data values for each execution?


Another obstacle that I am running into is that the automated test runs so fast that button clicks are not recoginzed because the button itself is not enabled when the click is performed.  I've increased my "WaitOnElementsTimeout" to 30000, but this still doesn't seem to help. If I institue a executioni pause, it works, but I cannot manually release the pause for each test.  Any suggestions.  UPDATE:  I've just discovered the execution delay.  I'm going to give that a try.

2 Answers, 1 is accepted

Sort by
0
Anthony
Telerik team
answered on 03 Jun 2011, 08:12 PM
Hello Kimberley,

Thanks for evaluating Test Studio.

Testing in different versions of the same browser will be tricky. If you have two versions of the same browser on one machine, Firefox 3.6 and 4 for example, Test Studio will only see the later version and use that. So you may need an additional machine or two (or VMs) to accomplish this.

Executing the same test with different data values is possible with Data Driven Testing. This feature allows you to add local data or an external data source, and bind the values in its columns to input fields in your tests. This way you will not need to write eight tests, but rather one test that is bound to a data source with eight rows. This test will run for eight iterations, one for each data row.

Regarding the execution delays: these should be used sparingly in your tests and only as a last resort. Verification and Wait steps are much more reliable. Please see the user's guide articles on Quick and Advanced Verifications.

All the best,
Anthony
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
Anthony
Telerik team
answered on 03 Jun 2011, 08:39 PM
Hello Kimberley,

I have a few additional notes about your data driven scenario. We thought of three options to handle this since values cannot be reused in your database:
  1. Include a delete step at the end of the test that erases everything just entered.
  2. Include a coded step at the beginning of the test that performs a SQL database restore.
  3. Include a coded step that automatically increments the values in the custom data source.

For option three, I found an applicable piece for code from this Telerik blog post, which deals with a similar need albeit in a different context.

/// <summary> 
/// Will be called when the test is databound. Use it to return your own data source. 
/// </summary> 
/// <param name="executionContext">The execution context</param> 
/// <returns>The data source else null.</returns> 
public System.Data.DataTable OnInitializeDataSource(ExecutionContext executionContext) 
       
return null
       }

Regarding the Verification steps, you may need to craft a step that verifies that the button is not disabled and set it to a Wait. That way Test Studio will not attempt to click the button until it is enabled. Please see our KB article on How to Verify the Disabled Attribute for more information.

Regards,
Anthony
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Tags
General Discussions
Asked by
Kimberley
Top achievements
Rank 1
Answers by
Anthony
Telerik team
Share this question
or