Telerik Forums
Testing Framework Forum
1 answer
350 views
Hello. I've recorder test from WebUI test studio. It records me like that:

using Telerik.WebAii.Controls.Html;
//using Telerik.WebAii.Controls.Xaml;
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
 
using ArtOfTest.Common.UnitTesting;
using ArtOfTest.WebAii.Core;
using ArtOfTest.WebAii.Controls.HtmlControls;
using ArtOfTest.WebAii.Controls.HtmlControls.HtmlAsserts;
using ArtOfTest.WebAii.Design;
using ArtOfTest.WebAii.Design.Execution;
using ArtOfTest.WebAii.ObjectModel;
using ArtOfTest.WebAii.Silverlight;
using ArtOfTest.WebAii.Silverlight.UI;
 
namespace SFTQuickStarts_NUnit_CS
{
 
 
    public class Login : BaseWebAiiTest
    {
        #region [ Dynamic Pages Reference ]
 
        private string loginPage; // path to site
        private string emulatorPath; // path to emulator
        private string credentials; // path to file with credentials
        private string sitePage; // path to file with site page
        private string login;
        private string pass;
        private Pages _pages;
 
        /// <summary>
        /// Gets the Pages object that has references
        /// to all the elements, frames or regions
        /// in this project.
        /// </summary>
        public Pages Pages
        {
            get
            {
                if (_pages == null)
                {
                    _pages = new Pages(Manager.Current);
                }
                return _pages;
            }
        }
    
        #endregion

It is working from WebUI studio. Then I moved this code to Visual Studio 2010. The automation library was connected. But

private Pages _pages;
 
public Pages Pages
        {
            get
            {
                if (_pages == null)
                {
                    _pages = new Pages(Manager.Current);
                }
                return _pages;
            }
        }

are marked as incorrect. After trying to build project I receive the next:

Error   1   The type or namespace name 'Pages' could not be found (are you missing a using directive or an assembly reference?) C:\Program Files\Telerik\WebUI Test Studio 2010.3\Samples\WebAii Framework\QuickStarts_NUnit_CS\Login.cs    32  17  QuickStarts_NUnit_CS
 
Error   2   The type or namespace name 'Pages' could not be found (are you missing a using directive or an assembly reference?) C:\Program Files\Telerik\WebUI Test Studio 2010.3\Samples\WebAii Framework\QuickStarts_NUnit_CS\Login.cs    39  16  QuickStarts_NUnit_CS

Please help me.
Keaegan
Telerik team
 answered on 16 Dec 2010
2 answers
98 views

Once the data source is binded to a test, we are able to control the data pointer using the below code.

var row = this.ExecutionContext.ActiveDataRows[1];
var dataString = row["Col1"];

But we are unable to control the data iteration to a particular row, say if we have 5 rows in an excel sheet and using the above code we can make the tool to start from particular row but not control to only particular row.

Impact: Due to this, we are unable to execute a specific row (Only One) out of 10 records available in the test data sheet.
Veera
Top achievements
Rank 1
 answered on 16 Dec 2010
1 answer
108 views
We tried using the in-bulit "Extract" option, but in the code view nothing is added. Only below comment is generated.

Hence, we require code (or) steps to use this extract feature where any application values are extracted to Output Results Sheet.


Keaegan
Telerik team
 answered on 16 Dec 2010
1 answer
160 views

We tried to use the below code from forum to bind data sheet dynamically, but not working.
http://blogs.msdn.com/b/mathew_aniyan/archive/2009/04/16/more-on-data-driving-coded-ui-tests.aspx

<DataSource("System.Data.OleDb", @"Provider=Microsoft.Jet.OLEDB.8.0;Data Source=C:\QTP_Scripts\hCue_Refresh_POC\hCue_POC_01\TestProject1\TestProject1\Data\hCue_Refresh.xls;Extended Properties='Excel 8.0;HDR=Yes;IMEX=1'", "Login$", DataAccessMethod.Sequential), TestMethod()> _

Cody
Telerik team
 answered on 16 Dec 2010
6 answers
177 views

Hi,

I am trying to open one Alert dialog and do some operation on it using webAii automation.The scenario is like this:

1.I want to delete a record.So I am selecting one record

2.Clicking on Remove selecetd record button.Onclick of this I am getting one Alert dialog.

3.After clicking on this button the Alert pop up is coming  and it is getting closed before the test script goes to next line

4.I am not able to capture the dialog in Dialog monitor

Please help me on this.

Cody
Telerik team
 answered on 15 Dec 2010
9 answers
161 views
hello


i am currently evaluating your product and so far i am very pleased with my results.
As i learned from some forum posts it is not possible to run multiple instances on one machine at the same time.
Because i need to verify correct user interaction and calculation i need to perform some custom actions at specific times, then continue with usual recorder/user actions  and validate the results.

i was able to reference my assemblies and create some code to write data to the DB but i also need to interact with the cache of the webserver.

i came up with the following ideas to cover my needs (as i didn't find anything about it in the forums)
1. use a dummy button to start actions to the webserver and call methods that perform the needed actions. this solution has the drawback of a postback which could change behavior of the application.
2. create a javascript function that starts an ajax request to the server and passes arguments from the Testing methods to webserver. i can then decide which actions to perform based on the arguement - for example clearing the cache, writing to DB and so on.
3. calling a web service

i would prefer solution 2 or something similar.
if i need to perform an action at a specific testing step i would use something like
Actions.InvokeScript(@"InitiateTestingStep("" + userid + "","" + TestHelperMethods.ClearCache + "");");
to pass the userid and an enumeration value.
the InitiateTestingStep method performs a server callback.
the function on the server checks for the second paramater to decide which action to perform.

is this a suitable approach to solve my problem or is there a built-in mechanism?

regards

Stoich
Telerik team
 answered on 08 Dec 2010
1 answer
97 views
Hi,
I got issue while selecting the value/item from the drop down box.
My Combo box contain name of the projects.
XYZ, YZ, ZAD
When i am trying to select the project XYZ (0th position in drop down box) from drop down box, Telerik is recording the action  as follwing -
Click Item0button
But if new project name is added in dropdown i.e. ABC which will automatically assigned to 0th position of the Drop down box.
When i run the Recorded stpes. Telerik is choosing / Selecting the 0th item from the drop down i.e. ABC instead of XYZ.

Thanks,
Madhav Jadhav
Helen
Telerik team
 answered on 06 Dec 2010
5 answers
156 views
hello


i already created some tests which use a datasource and also pass it along to "sub-tests", meaning to tests which are executed as a step inside a test. to make my tests modular and use the same test with different data i would like to create a test structure as follows:

i have one big test case which consists of some usual teststeps, custom coded steps and sub-tests.
for example the overall Testcase "mastertest" starts with a subtest "Login" which simply performs a login with given credentials.
the login data is passed from the mastertest to the subtest.
after login i do some some navigation and then call  a subtest called "createCategory".
the "createCategory" performs some actions and uses also data from an excel file but i would like to specific which excel file to use for this specific call. the data for createCategory consists of multiple columns and 3 rows to excecute it 3 times with different data.  this behavior will be used again in createCategory to call another subtest and so on.

for my automatic tests to run i would prepare 3 excel files for the mastertest to cover 3 different use cases. i start the mastertest once which each excel file. depending on the data provided in the excel file different data is passed to the subtests.

Can i set the datasource for each test dynamically? if so could you provide me with a short example?
If this specific approach is currently not possible is there any other way to create modular test with various datasources?
the other option would be to create one test with one datasource, copy this test and exchange the datasource but this would be hard to maintain if tests need to be adapted/extended.


Regards
Cody
Telerik team
 answered on 04 Dec 2010
7 answers
954 views
Hi,
I want to select from a drop down list using webAii, C#.
Initially the drop down is hidden. After clicking a radio button, drop down control becomes visible. It is set a default value. I need to select a differnt value from it.
Below is the html
<input type="hidden" name="firstnameId" value="" />
<select class="name_selector" name="firstnameId" id="namesetselector">                               
   <option class="name_selector_option" value="1">Sam</option>
   <option class="name_selector_option" value="2">Mark</option>
   <option class="name_selector_option" value="3">Sean</option>
</select>

The code I have written is,
HtmlSelect name = AB.Find.ByAttributes<HtmlSelect>("class=name_selector");
name.SelectByValue("3");

When I click the radio button and the drop down list becomes visible, by default the first option is selected. The above c# code that I have written actually selects the 3rd option in the drop-drown. Later on when I submit the page and open it, the option selected is the default one i.e. the first one. Is there a reason to this? When I do this operation manually it works fine.
Thanks
Stoich
Telerik team
 answered on 01 Dec 2010
11 answers
132 views
Hi,

  I have some Silverlight UI Automation tests running correctly on my local machine, however, on the build machine, I keep run into "ArtOfTest.WebAii.Silverlight.ApplicationNotReadyException" as it navigates to the url properly but failed to execute any steps within Silverlight.

  I have attached the .trx file.

  Any ideas?  


Cody
Telerik team
 answered on 26 Nov 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?