1

I have assembly with UI automation tests (White).

I've introduced a class with all Autination Id's to be reused in this assembly:

public static class AutomationId
{
    public static class Toolbar
    {
        public const string MyControl = "MyControlId";
    }
}

And now i'm trying to use it in my test class (the same assembly):

var control = mainWindow.Get<Button>(AutomationId.Toolbar.MyControl);

This code can be compiled locally. But on TeamCity I'm getting a such error:

The name 'AutomationId' does not exist in the current context
leppie
  • 115,091
  • 17
  • 196
  • 297
dr11
  • 5,166
  • 11
  • 35
  • 77

1 Answers1

2

It's a C# 6 feature. Similar problem: The name 'nameof' does not exist in the current context

I encountered this problem just now, which lead me here. My research indicates that you need to update Teamcity:

http://dave.ninja/2015/08/06/upgrading-teamcity-to-support-visual-studio-2015/

We still have to do this, as well. The post above shows a lot of solutions to issues that they encountered while upgrading. Didn't seem a too painful process.

Leperkawn
  • 183
  • 2
  • 11