Problem with Custom ControlType

Jun 23, 2010 at 7:39 PM
Edited Jun 23, 2010 at 7:42 PM

Hi, I just started playing with White and can't figure out how to access some items.

The relevant part of the tree in UISpy looks like this:

window - "Modules" - "modulesWindow"

   custom - "" - "adminProjectsDataGrid"

      datagrid - "" - "viewListView"

 

I manage to access the window, and I access the "custom" as a UIItem but an exception is raised when trying to get datagrid.

Here is the code and the exception occurs on the last row.

 

// Get the modules window

modulesWindow = window.ModalWindow("Modules");

Assert.IsNotNull(modulesWindow);

// Select admin projects

UIItem adminProjects = (UIItem)modulesWindow.Get(SearchCriteria.ByAutomationId("adminProjectsDataGrid"));

Assert.IsNotNull(adminProjects);

// Select admin projects list

ListView adminProjectsList = (ListView)adminProjects.Get(SearchCriteria.ByAutomationId("viewListView"));

 

 

Can somebody help me?

/Michael

Jun 24, 2010 at 5:49 AM

Hi

first try to get the datagarid directly from the window. Does this work?

next you should have a look for: how to work with custom UIItems

then you can fall back to your first solution.

Throndorin

 

 

 

 

 

Jun 24, 2010 at 8:37 AM

Thanks Throndorin,

I was able to get the datagrid directly from the window but I have many instances of the same custom type.

I read about custom UIItems and that solution is much more appealing! It didn't take much time before it was working nicely!

/Michael