How to get a Test Configuration's static Parameter's Default Value using ALM OTA from Test Plan? - hp-uft

I have to automate certain test cases, which inturn have more than 100 test configurations. These are not manual test types, but rather Business Components each configuration having it's own configuration Test data (static type) in Test Plan. So far, I am able to get each configuration's Test Parameters Name but not their Default value as available in Test Plan > Test > Configuration Tab > Data sub tab
<TestObject>.TestConfigFactory.Newlist("")(1).ParameterValueFactory.Newlist("").Item(1).Name
This gives the name of the configuration parameter name. The method "DefaultValue" is null for each test data, even though on visual inspection it does contain the value.
I am using VBScript.

Related

How to check if ModuleController has selected Controller before the test runs?

I have tests (JMX) with modular controllers and sometimes throw an error when they are started when there are modular controllers without a controller selected.
Is there a way to verify if every (enabled) modular controller has an associated controller?
As of JMeter 5.4.1 it is not possible to "validate" the Module Controllers without actually running your tests, the Test Plan Tree is being built in the runtime from the test elements provided and controllers like Module Controller or Include Controller basically modify the Test Plan Tree on the fly creating one big test plan from reusable fragments or external scripts.
So the options are in:
Perform a dry-run with 1-2 users/iterations to see whether your test still works, produces .jtl file without errors, etc.
It's also possible to run JMeter from Java code so you could come up with an utility which will do the test plan checking basing on your acceptance criteria

config.properties file with multiple urls

I have a configuration file with multiple url's and needs to be sent depending on test scenario.
But in one scenario the url is being sent and in another it is not. Please suggest the change
Tried modifying the names , loops but could not find the correct solution.
the TPurl property is being returned as null either while running as testNG suite or as an individual test.

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'

VS.NET Load Testing - pass site URL via parameter

I'm building VS.NEt 2010 Load Test solution.
Everything works really good except one thing. When I record .webtest script - it grabs the site domain name, like so:
http://test1/page1
http://test1/page2
So the test1 is hardcoded in the script.
What I would like to do is to run same load test again different test environment - the goal is to compare two environment without rewriting the recording.
I see that Run Settings has "Context Parameters" - is this it?
For for a recorded .webtest, this article shows using the context parameters with the {{parameterName}} syntax for form parameters, and can indeed be used for the server name.
From inside a coded test (which inherits from WebTest), you can access it with:
this.Context["KeyName"]

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.

Resources