Capturing Role and Name property

Ask general questions here.
mohandasgandhig
Posts: 2
Joined: Wed Aug 01, 2007 6:59 am
Location: Bangalore
Contact:

Capturing Role and Name property

Post by mohandasgandhig » Wed Aug 01, 2007 7:50 am

Hi all,

I am trying to capture Role and name proeprty for toolstrip items but I could not . Is there any specific win32APIs for capturing these proerties?
Please clarify me.

Thanks,
Mohan

webops
Site Admin
Site Admin
Posts: 349
Joined: Wed Jul 05, 2006 7:44 pm

Post by webops » Wed Aug 01, 2007 4:21 pm

The following sample code works with the VS2005Application.exe (Ranorex\Bin\Net2.0 directory).
It searches the toolstrip of the application, finds the toolstrip item with the Role=PushButton and Name="Test Progressbar" and clicks the button.

Code: Select all

ToolStrip toolStrip = form.FindToolStrip("toolStrip1");
if (toolStrip != null)
{
    // Find the pushbutton of the toolstrip by Role=PushButton and Name="Test Progressbar"
    Element progressBarButton = toolStrip.Element.FindChild(Role.PushButton, "Test Progressbar");
    if (progressBarButton != null)
        Mouse.ClickElement(progressBarButton);
}
Jenö
Ranorex Team

mohandasgandhig
Posts: 2
Joined: Wed Aug 01, 2007 6:59 am
Location: Bangalore
Contact:

Post by mohandasgandhig » Thu Aug 02, 2007 5:34 am

Hi,

Thanks for your quick reply. My questing here is how to capture Role and Name property with out using Ranorex lib files.

Thanks,
Mohan