Rotaney
Rotaney

Reputation: 247

A record Coded UI Test don´t run

Visual studio 2010 and vs2012 are installed on my virtual maschine (windows server 2008 R2 64 bit). I want to create and test any Coded UI Test in VS2012.

situation: I can create and debug an application with vs2012 - it works. A Coded UI Test I can record, but not run. In my opinion the record don´t works correct, because I get the following output over error-list in VS2012: "Identifier expected - File: UIMap.Designer.cs - Line:51 - Column:42". (This is the following method:

public void closeBrwoser()
    {
        #region Variable Declarations
        BrowserWindow uIGoogleWindowsInterneWindow = this.UIGoogleWindowsInterneWindow;
        #endregion

        // 
        uIGoogleWindowsInterneWindow.(); //this is Line 51
    }

The same Coded UI Test in VS2010 (record in VS2010) works. Where is the problem in vs2012? Can you help me?

vs2012 has only problems with "closing the browser". If I exclude "closing the browser" the test works.

thanks

Upvotes: 0

Views: 1351

Answers (2)

Rotaney
Rotaney

Reputation: 247

thank you for your fast answer:) You are right - the record is wrong (in this method I should not write). I had recorded frequently the test. VS2012 write the Test wrong again and again. The same method in my other VS2012 (on my local machine) looks like this:

    public void closeBrowser()
    {
        #region Variable Declarations
        WinButton uISchließenButton = this.UIHomepageMicrosoftIntWindow.UIHomepageMicrosoftIntTitleBar.UISchließenButton;
        #endregion

        // Click 'Schließen' button
        Mouse.Click(uISchließenButton, new Point(22, 4));
    }

The Method in VS2010 (in the VM windows server 2008 R2 64 bit) looks like this:

    public void closebrwoser02()
    {
        #region Variable Declarations
        WinButton uISchließenButton = this.UIGoogleWindowsInterneWindow.UIGoogleWindowsInterneTitleBar.UISchließenButton;
        #endregion

        // Click 'Schließen' button
        Mouse.Click(uISchließenButton, new Point(13, 8));
    }

only vs2012 (in the VM windows server 2008 R2 64 bit) don´t work. Why? what can I do?

Short addition: vs2012 has only problems with "closing the browser". If I exclude "closing the browser" the test works.

Upvotes: 0

Arran
Arran

Reputation: 25076

You've got a final . at the end of the variable name, but are not calling anything.

uIGoogleWindowsInterneWindow.();

should be something like:

uIGoogleWindowsInterneWindow.Quit();

Assuming you have a Quit method that is, probably something to quit the current browser window.

I would highly doubt this runs in VS 2010. It is likely different source code, it is a compiler error, therefore it will fail in 2010 as well.

I would also doubt the recorded did this, I would delete the test and rebuild it, and I am sure it will work.

Upvotes: 1

Related Questions