2015-04-01 88 views
1

我有用於UI自動化測試(白色)的程序集。在當前上下文中不存在名稱'AutomationId'

我介紹了一個類的所有Autination標識在該組件被重用:

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

,現在我嘗試使用它在我的測試類(相同的程序集):

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

這段代碼可以在本地編譯。但在TeamCity上,我收到了一個這樣的錯誤:

The name 'AutomationId' does not exist in the current context 

回答

相關問題