Please make sure your test code behind is compiled with your latest changes

2 posts, 0 answers
  1. Ellery
    Ellery avatar
    1 posts
    Member since:
    Oct 2012

    Posted 09 Oct 2012 Link to this post

    Developed an abstract class for db connections, i want to use these class in a code step, but logically i can't make an instance of these class, so, in my abstract class inherited from BaseWebAiiTest and then inherited from my abstract class in the main class of my code behind.
    For example:
    My Abstrac Class
    public abstract class ConDB : BaseWebAiiTest
    private SqlConnection _conn;
    private SqlCommand _command;
    private bool disposed = false;
    public ConDB(string nameConn = "Conn")
    this._conn = new SqlConnection(ConfigurationManager.AppSettings[nameConn].ToString());
    this._command = this._conn.CreateCommand();
    this._command.CommandType = System.Data.CommandType.StoredProcedure;
    public void ExecuteNoQuery(string spName, SqlParameter[] parameters)
    this._command.CommandType = System.Data.CommandType.StoredProcedure;
    this._command.CommandText = spName;
    if (this._conn.State != ConnectionState.Open)
    In my codebehind file instead of
    public class AltamasEstablecerContraseña : BaseWebAiiTest
    I wrote
    public class AltamasEstablecerContraseña : ConDB
    So, When i try to run the test appear the error:
    Please make sure your test code behind is compiled with your latest changes
    And all my codebehind files are compiled sucessfully
    Please help me, thanks in advance!!
  2. Stoich
    Stoich avatar
    1 posts

    Posted 12 Oct 2012 Link to this post

    Hi Ellery,
    I'm not sure why you're getting this error message:
    Please make sure your test code behind is compiled with your latest changes
    I've seen it before but it's been a while. Are you using Visual Studio 2008? You might simply need to build the project (which might be as simple as pressing F6).

    In any case: you probably shouldn't try to modify the code-behind file
    public class AltamasEstablecerContraseña : BaseWebAiiTest

    The code-behind file has a special relation to the corresponding test and I highly recommend that you don't change the class it inherits. Instead why not put the SQL logic in a separate, non-abstract class. Then you can invoke the logic from a coded step from your BaseWebAiiTest class:

    Or you can even create a separate project for this:

    The following article might be of interest for you also:

    Kind regards,
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
Back to Top