How to perform data driven load testing using LoadUI - user-interface

I am load testing a web service.
Is it possible to perform data driven testing using loadui? If yes, how?
We can just give requests to web runner (where url is given) but I am not able to feed any data.

This article in the loadUI documentation explains how you do it. Basically, you have to use a soapUI DataSource via the soapUI Runner.

You can do this with SoapUI & LoadUI [with free versions :-) ]
In SoapUI create a TestSuite, then create TestCase. In TestCase define custom property... for example property with name "firstName"
Then in your request you can use values like this
${#TestCase#firstName}
Save a project and open LoadUI.
click on FLOW -> choose DataSource
Browse your input file. Right Click -> settings , modify separator for your needs.
check loop option to TRUE.
After that, you can use some Runner, right click on it -> Settings -> Properties
Now you can see all TestCase Properties (defined in SoapUI).
Now u need just to make transfer from datasource to SoapUIRunner
For column value you can use someting like this:
${#Data Source 1#firstName}\
Hope this helps.
Cheers
Nikola

Related

JMeter embedded resources not named correctly

I'm using an HTTP sampler to download embedded resources. Here's is the example from python.org. I was expecting the the names of the embedded resources to match the actual request. But instead they're named the same as the parent sample. Could be by product of HTTPS? I'm using JMeter 5.3.
This is a part of enhancement introduced in JMeter 5.0, see Bug 62550 - Modify SubResult Naming Policy for details.
If the previous behaviour is really what you're looking for you can get it back in 2 ways:
Tick "Functional Test Mode" box at Test Plan level
Add subresults.disable_renaming=true line to user.properties file
when you record the transaction it should generate the sample names normally.
Are you using parallel controller ?
Actually you can tweak with settings of naming policy in jmeter properties.

Retrieve Test settings using Rest API from TFS

How can i retrieve Test settings using Rest API from TFS.
The below mentioned URL is the best i can get . but this is for Test result retention setting...... and what i am looking for is regular/ general Test settings.
Can some one please provide a sample URL for it.
Sample URL:- https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/Fabrikam/_apis/test/resultretentionsettings?api-version=2.0-preview"
If you mean the test settings file (See Specifying Test Settings for Visual Studio Tests), then you can get and open the file from web portal to check the settings.
If you mean Test configurations, you can refer to this link for the REST API : Test configurations:
e.g.: To Get a test configuration:
GET https://{instance}/DefaultCollection/{project}/_apis/test/configurations/{configurationId}?api-version={version}
Whatever, all the available test REST APIs are all here: Test Management
UPDATE:
According to your clarification (below answer), you just want to get the specific test run details. You can use below REST API to Get a test run:
GET http://{instance}/DefaultCollection/{project}/_apis/test/runs/{run ID}?api-version={version}
Then you will see all the settings/properties of the specific test run.
No what I really meant for was the "Test Settings" information. In MTM, we can specify the TestSettngs via TestSettings Manager.( See the below image.)
While creating a test run, we need to provide this "Test Settings" information.
Next, coming to REST API, we can create a test run using REST API too.
The below is the API reference url.
https://www.visualstudio.com/en-us/docs/integrate/api/test/overview
Under "Create a Test Run" section, you can see "test settings" under the content type. I wanted to know how to get that information via REST call(
Check see image 2 below)
(I am unable to embed pictures on the site as i have not earned 10 reputation points. please open the links provided below to view the images)

Simple Coded UI login test on remote server

I used Microsoft Test Manager to create a test for a log on page (not locally hosted) and recorded this. All steps were executed without errors.
Then I've created a Coded UI test project in Visual Studio 2013.
I added a Coded UI Test with the existing recording.
I ran the test and I got the message below:
"FailedToPerformActionOnHiddenControlException: Cannot perform 'SetProperty of Text with value " on the username field.
I received this message when using the existing recording, but also if I record using the recording function in Visual Studio.
Has someone got experience with Coded UI Tests and maybe give me an example as to how to set it up.
If I understand correctly, you're basically trying to have Coded UI input a value into an HtmlInput control that's a text box on a web page. The error message "FailedToPerformActionOnHiddenControlException: Cannot perform 'SetProperty of Text with value" normally means that the value you're trying to submit isn't able to be taken by the control, either because a value isn't accepted (example, numeric values in a name field) or because it's more characters than can be accepted by the field. It could also be that the recording isn't defining the object properly, and that the property Text isn't an option on the control that was found.
So, confirm these three things:
1. The control you're tying to send value to is actually an HtmlInput. You can't send the Text property to, for example, an `HtmlDiv`.
2. The value you're submitting is a valid value for your control (you're not trying to submit numbers, for example, into a field that won't accept them).
3. The value you're submitting is within the length limit for the field.
If I were a betting man, I would say that you probably don't have the object defined properly. Take a look at the SearchProperties of the control in question first and make sure that it matches the HTML on the page itself.
Do I need to set a standard environment for testing on an other server.
I develop the Coded UI test project in a workspace on a development environment, but I need the tests to be run on a acceptation environment (the recorded tests are executed on the acceptation environment).
I read it's easy to setup this environment though, but what is best practise?
Is it better to execute it on the same environment?
Here's a code snippet:
[TestMethod]
public void TestLogonToAccount()
{
// To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items.
this.UIMap.Enterusername();
this.UIMap.Enterpassword();
this.UIMap.Clickonlogin();
this.UIMap.ClickonCentral();
this.UIMap.Searchforemailaddress();
this.UIMap.Clickonlogin1();
}
I forgot an important part regarding the login recording test in MTM.
I just tried to play the steps again and got this error:
Playback of the selected sections of the action recording could not be completed The playback failed to find the control with the
given search properties. Additional Details: TechnologyName: 'MSAA'
Name: '' ClassName: 'MozillaWindowClass' ControlType: 'Window'

Packaging Visual Studio LoadTest Solution

I have a VS 2010 Load test solution that contains quite a web tests and a bunch of Load tests. All of the web tests in this solution are data driven and use a SQL DB as the data source. Also, all of the data sources are set to random access method.
Now, whenever I change the data source or copy this solution to a different machine to test another deployment, I have to manually change the data source for all the web tests. The moment I change the data source, the access method gets reset to "sequential" which is the default setting. Now, I will have to change the access method also manually.
So, Is there a way I can package the VS Load Test solution so that the data source and access methods can be specified as parameters to the deployment package?
Note: Only the data source name changes but not the SQL DB schema for the data driven web tests.
The DataSourceAttribute can get all of it's properties from the configurations file of the application.
Here is a page that tells you how to use configuration files to place the connection string.
Walkthrough: Using a Configuration File to Define a Data Source
As you can see you may place the connection string in the app.config file, in the section <microsoft.visualstudio.qualitytools>:
<microsoft.visualstudio.testtools>
<dataSources>
<add name="MyJetDataSource" connectionString="MyJetConn" dataTableName="MyDataTable" dataAccessMethod="Sequential"/>
<add name="MyExcelDataSource" connectionString="MyExcelConn" dataTableName="Sheet1$" dataAccessMethod="Sequential"/>
</dataSources>
</microsoft.visualstudio.testtools>
In code usage of attribute:
[DataSource("MyJetDataSource")]
Reference:
The following links are just for reference:
How to: Create a Data-Driven Unit Test : creating data-sriven tests
Working with Load Tests : understanding load tests
DataSourceAttribute Class : docs for the attribute
DataSourceAttribute Constructor (String) : ctor that allows external connection string
DataSourceAttribute.DataSourceSettingName Property
Covert the web tests into coded web tests. In the code you will see the data binding code. Whenever you change the data source you can simply use find and replace all for data source name.
I don't think there is way to include this in deployment package.

VS2010 Web Load Testing with User Logins

I am looking to create a Web Performance test that can be bound to a CSV file with usernames and passwords so that I can run concurrent tests with different users. How do I modify a recorded WebTest in order to accomplish this?
Have you checked out Walkthrough: Adding Data Binding to a Web Performance Test (CSV File)?
Once you have added the csv file as a datasource to the webtest,
right click on the webtest.
select "properties"
set the username property to the
correct datasource field
set the password property likewise

Resources