After downloading the extension, add the DLL to your references under your Coded UI Project. Please find below the sample documentation
#Coded UI Usability Automation using JavaScript
# Send your feedback to
rankumar@microsoft.com /
rajkamal@microsoft.com
//This
method retreives the properties of hyperlink with inner text "News"
and "Hotmail"
[TestMethod]
public void CodedUITestMethod1()
{
bw.WaitForControlReady();
ListRepository> list =
UsabilityAutomation.Usability.GetUsabilityProperties(bw, "a", "News,Hotmail");
foreach (UsabilityAutomation.Repository prop in list)
{
Assert.AreEqual(prop.font_family,
"Arial,Sans-Serif");
Assert.AreEqual(prop.text_decoration,
"none");
}
}
//This method retrieves the properties of
div element whose id is "hp_container "
[TestMethod]
public void CodedUITestMethod2()
{
bw.WaitForControlReady();
ListRepository> list =
UsabilityAutomation.Usability.GetUsabilityProperties(bw, "div","hp_container");
foreach
(UsabilityAutomation.Repository prop in list)
{
Assert.AreEqual(prop.margin_left,
"117px");
Assert.AreEqual(prop.font_size,
"13.33px");
Assert.AreEqual(prop.width,
"1366px");
Assert.AreEqual(prop.color,
"rgb(0, 0, 0)");
}
}
//This method retrieves the properties of
input element whose id is "sb_form_q"
[TestMethod]
public void CodedUITestMethod3()
{
bw.WaitForControlReady();
ListRepository> list =
UsabilityAutomation.Usability.GetUsabilityProperties(bw, "input", "sb_form_q");
foreach
(UsabilityAutomation.Repository prop in list)
{
Assert.AreEqual(prop.padding_left,
"9px");
Assert.AreEqual(prop.padding_right,
"5px");
}
}
//This method retrieves the properties of
all input element present on the page
[TestMethod]
public void CodedUITestMethod4()
{
bw.WaitForControlReady();
ListRepository> list =
UsabilityAutomation.Usability.GetUsabilityProperties(bw, "input");
foreach
(UsabilityAutomation.Repository prop in list)
{
// your assert logic
}
}