Add Code behind file to your test (error)

3 posts, 0 answers
  1. Mostafa
    Mostafa avatar
    22 posts
    Member since:
    Aug 2012

    Posted 05 Sep 2011 Link to this post

    hi telerik Team,

    I need to evaluate the telerik test studio for possible use with wpf applications.

    I now have a problem with the produce of code behind each step.

    I do the following steps in the VS-plugin Version:
    1) Add code behind file to your test
    2) then I get the namespace with a class...(for example: versuchen.tstest.cs)
    3) then I make the step: "Customize Step in Code"
    4) I get the method in the class (for example: versuchen.tstest.cs) and therefore I have the following result :
    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Linq;
    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;
    using ArtOfTest.WebAii.Wpf;
    using Telerik.WebAii.Controls.Html;
    using Telerik.WebAii.Controls.Xaml;
    namespace CodeStep
    // You can add custom execution steps by simply
    // adding a void function and decorating it with the [CodedStep] 
    // attribute to the test method. 
    // Those steps will automatically show up in the test steps on save.
    // The BaseWebAiiTest exposes all key objects that you can use
    // to access the current testcase context. [i.e. ActiveBrowser, Find ..etc]
    // Data driven tests can use the Data[columnIndex] or Data["columnName"] 
    // to access data for a specific data iteration.
    // Example:
    // [CodedStep("MyCustom Step Description")]
    // public void MyCustomStep()
    // {
    // // Custom code goes here
    // Applications.Spreadsheetexe.Book1__Spreadsheet.InsertTabitem.User.Click(); 
    // }
    public class versuchen : BaseWebAiiTest
    #region [ Dynamic Applications Reference ]
    private Applications _applications;
    /// <summary>
    /// Gets the Applications object that has references
    /// to all the elements, windows or regions
    /// in this project.
    /// </summary>
    public Applications Applications
    if (_applications == null)
    _applications = new Applications(Manager.Current);
    return _applications;
    [CodedStep(@"Type 'test' into PasswordTextBoxPasswordbox")]
    public void versuchen_CodedStep()
    // Type 'test' into PasswordTextBoxPasswordbox
    Applications.WpfClientexe..PasswordTextBoxPasswordbox.SetPassword(true, "test", 10, 100);
    // Add your test methods here...
    5) I save it and build the project, then I get the following error: (see  error.7z)
    6) and when i execute the steps or the code, i get the following error:

    '05.09.2011 17:32:46' - Starting execution....'05.09.2011 17:33:00' - Detected custom code in test. Locating test assembly: CodeStep.dll.'05.09.2011 17:33:00' - Failure detected during execution. Details:
    '05.09.2011 17:33:00' - System.IO.FileNotFoundException: Unable to find the code behind assembly. Please make sure you have compiled your code behind without errors before attempting to execute the test. Looking for: c:\users\al-jendi\documents\visual studio 2010\Projects\CodeStep\CodeStep\bin\Debug\CodeStep.dllIf you are running VS 2010, make sure Deployment is checked in your .settings file (in the solution items) at ArtOfTest.WebAii.Design.Execution.ExecutionUtils.EnsureAssemblyExists(String assembly, String folder) at ArtOfTest.WebAii.Design.Execution.ExecutionUtils.CreateCodedTestInstance(Test test, TestResult result, String binariesFolder) at ArtOfTest.WebAii.Design.Execution.ExecutionEngine.InternalExecuteTest(Test test, TestResult initializationResult) at ArtOfTest.WebAii.Design.Execution.TestExecuteProxy.ExecuteTest(Test test, Settings settings, String deploymentFolder, String binariesFolder, ExecutionType exeType, Guid firstStepGuid, Guid lastStepGuid, IntPtr existingBrowserHandle, DebuggerOptions debuggerOptions)
    '05.09.2011 17:33:01' - Test completed!

    Thanks Telerik Team

  2. Cody
    Cody avatar
    3360 posts

    Posted 06 Sep 2011 Link to this post

    Hello Mostafa,

    I just had another customer get the same compilation error that you reported. The problem is caused by one of your Window nodes not having a FriendlyName to be used in the auto-generated Pages.g.cs file. Specify a FriendlyName and the problem will be solved (see attached screen shot).

    Kind regards,
    the Telerik team
    Vote for Telerik Test Studio at the Annual Automation Honors Voting!
  3. Mostafa
    Mostafa avatar
    22 posts
    Member since:
    Aug 2012

    Posted 09 Sep 2011 Link to this post

    Thanks for your help,

Back to Top