I have a button that looks like this on the page...
<input name="ctl01" type="submit" class="btn" onclick="set_hit_submit_button()" value=" Search " />
When I set up this button in the object repository, I created it like this...
public CUITe_HtmlInputButton btnSearch = new CUITe_HtmlInputButton("Value= Search ");
Actually, the Object recorder created like this...
public CUITe_HtmlInputButton btnSearch = new CUITe_HtmlInputButton("Name=ctl01;Name=ctl01;Value= Search ");
That could be another issue with the recorder
Anyways, on playback, I got the error about not finding the control because when searching, the whitespace after search was trimmed.
Test method BugTracker.CUITe.Tests.SearchTest.SearchUsingReportedByFieldOnly threw exception:
Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException: The playback failed to find the control with the given search properties. Additional Details:
ValueAttribute: ' Search'
Failed to find any control that matched the search condition ControlType='Button' && ValueAttribute=' Search' ---> System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.
The site I'm automating used whitespace to make the button bigger so I think this is a valid case where whitespace should be supported in the attributes of controls.