How to click this button (onyl available if another element is selected)

May 12, 2009 at 1:45 PM
Edited May 12, 2009 at 2:16 PM

Hi I'm new in using White.

 

The following Problem

image from UI Automation Verify

 

The selected browse button only appears if the table element with name "Checks" is selected

 

Is there an easy way to get this button clicked?

 

Throndorin

 

May 14, 2009 at 10:43 AM
Edited May 14, 2009 at 10:51 AM

I have found a solution :)

This works with the property pane of Visual Studio 2008

 
public static void PressPropertyButton(Window testProjectWindow, string propertyElement, string buttonName)
{
//get all autmation elements of the property windows
AutomationElementList propertyWindowsColl = GetElementListOfProjectPropertyWindow(testProjectWindow);

//get the needed property
AutomationElement property = propertyWindowsColl.Where(p => p.Current.Name == propertyElement).First();
AutomationElementHelper.PerformButtonClickOnAutomationElement(testProjectWindow, property);

//get the appearing button
Button propertyButton = (Button)testProjectWindow.Get(SearchCriteria.ByControlType(ControlType.Button).AndByText(buttonName));

propertyButton.Click();
}
Coordinator
May 25, 2009 at 8:03 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.