Skip to content

Upgrading from v1.0 to v2.0

Rami edited this page Apr 15, 2016 · 15 revisions

Required steps to upgrade from v1.0 to v2.0

  1. Remove all references to the old CUITe assembly.

  2. Reference Microsoft Coded UI controls using their full namespace to avoid conflict with the new CUITe controls namespaces.
    For example, if a document has using Microsoft.VisualStudio.TestTools.UITesting.HtmlControls; either:
    A. Remove it and replace HtmlButton with Microsoft.VisualStudio.TestTools.UITesting.HtmlControls.HtmlButton.
    or
    B. Replace it with an alias (ex. using CUITControls = Microsoft.VisualStudio.TestTools.UITesting.HtmlControls;) and replace HtmlButton with CUITControls.HtmlButton.

  3. Add a reference to the new CUITe NuGet package appropriate to your version of Visual Studio and UI technology.

  4. Remove all instances of CUITe_ in the source code.

  5. Replace all instances of .Get< with .Find<.

  6. Replace all search properties with their equivalent fluent syntax.
    For example, replace the following:

Old New Alternate
"Name=MyControlName" By.Name("MyControlName") .AndName("MyControlName")
"ControlId=1234" By.Id("1234") .AndId("1234")
"Automationid=MyAutomationId" By.Automationid("MyAutomationId") .AndAutomationid("MyAutomationId")
"ClassName=MyClassName" By.ClassName("MyClassName") .AndClassName("MyClassName")

All other search properties can use the generic By.SearchProperties("OtherSearchProperty=Value") or .AndSearchProperties("OtherSearchProperty=Value")

The new fluent syntax requires adding the using statement using CUITe.SearchConfigurations;.

  1. Replace all controls referenced by their old type to the new type.
    For example, replace the following:
Old New
BrowserWindow BrowserWindowUnderTest
SlButton SilverlightButton
SlCalendar SilverlightCalendar
SlCell SilverlightCell
SlCheckBox SilverlightCheckBox
SlComboBox SilverlightComboBox
SlControl SilverlightControl
SlDataPager SilverlightDataPager
SlDatePicker SilverlightDatePicker
SlEdit SilverlightEdit
SlHyperlink SilverlightHyperlink
SlImage SilverlightImage
SlLabel SilverlightLabel
SlList SilverlightList
SlPassword SilverlightPassword
SlRadioButton SilverlightRadioButton
SlSlider SilverlightSlider
SlSpinner SilverlightSpinner
SlTab SilverlightTab
SlTabItem SilverlightTabItem
SlTable SilverlightTable
SlText SilverlightText
SlTree SilverlightTree
  1. Replace deprecated methods with their equivalent property getters and setters.
    For example, replace the following:
Old New
.GetText() .Text
.SetText("MyText") .Text = "MyText"
.UnWrap() .SourceControl
  1. If inheriting from SilverlightControl, change the constructor as follows:
Old New
MyCustomControl(string searchParameters) MyCustomControl(By searchConfiguration)
Clone this wiki locally