Acces to a control

Aug 5, 2008 at 3:07 PM
hi, how can i acces to a control, if this control its dinamically created and has no name and no text, " i mean a Textbox".

i can acces by his tag, handler, or how??

thanks!!
Coordinator
Aug 6, 2008 at 3:14 PM
Are you trying to automate Win32 application? Have you used UISpy and checked whether it has automationid, name on it.
Aug 6, 2008 at 5:49 PM
yes, its a winform .Net app. and when im debugging the apps, i get the automationid for a control, but , when using SearhCriteria.Byautomationid, comes null. dont found nothing!!!

Coordinator
Aug 7, 2008 at 3:58 PM
since you are finding the window can you send me your code and output of window.LogStructure() to me.
Aug 11, 2008 at 1:24 PM

string

path = @"C:\Documents and Settings\luis.tirado\Desktop\Advanced.Registry.ID\Advanced.Civil.ID.Station\bin\Debug\Advanced.Civil.Registry.Station.exe";

Core.Application application = Core.Application.Launch(path);

Window window = application.GetWindow("Advanced.Civil.Registry® - Station", InitializeOption.NoCache);

Core.UIItems.Image imagen1 = window.Get<Core.UIItems.Image>("PictureBox4");

imagen1.DoubleClick();

System.Windows.Forms.Application.DoEvents();

Window window2 = application.GetWindow("Advanced.Civil.Registry®", InitializeOption.NoCache);// the window object close so, i create another reference

SearchCriteria busca = SearchCriteria.ByText("Register");

 

Core.UIItems.MenuItems.Menu bot = window2.Get<Core.UIItems.MenuItems.Menu>(busca);

bot.Click();

System.Windows.Forms.Application.DoEvents();

SearchCriteria busca2 = SearchCriteria.ByText("Marriages registration");

 

Core.UIItems.MenuItems.Menu bot2 = window2.Get<Core.UIItems.MenuItems.Menu>(busca2);

bot2.Click();

//here, dont do anything, dont get any error!!, and procesor go to 100%, this works in other form, of the same Application with same properties
SearchCriteria buscaid2 = SearchCriteria.ByControlType(typeof(Core.UIItems.WinFormTextBox)).AndIndex(4);
Core.UIItems.WinFormTextBox wey32 = window2.Get<Core.UIItems.WinFormTextBox>(buscaid2);
wey32.Text = "test 02";

//the problem, in the foreach, i have not message, the processor go to 100%, //here, dont do anything, dont get any error!!,   this works in other form, of the same Application with same properties

 

foreach (var item in window2.Items)

{

MessageBox.Show(item.GetType().ToString());

}

*****************************LOG OUTPUT******************************

 

'First_Gui_Test_001.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'First_Gui_Test_001.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities\9.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'First_Gui_Test_001.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Windows.Forms\2.0.0.0__b77a5c561934e089\System.Windows.Forms.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'First_Gui_Test_001.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'First_Gui_Test_001.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'First_Gui_Test_001.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities.Sync\9.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.Sync.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'First_Gui_Test_001.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.Debugger.Runtime\9.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Debugger.Runtime.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'First_Gui_Test_001.vshost.exe' (Managed): Loaded 'C:\Documents and Settings\luis.tirado\My Documents\Visual Studio 2008\Projects\UI TEST\First_Gui_Test_001\First_Gui_Test_001\bin\Debug\First_Gui_Test_001.vshost.exe', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'First_Gui_Test_001.vshost.exe' (Managed): Loaded 'C:\Documents and Settings\luis.tirado\My Documents\Visual Studio 2008\Projects\UI TEST\First_Gui_Test_001\First_Gui_Test_001\bin\Debug\nunit.framework.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'First_Gui_Test_001.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_32\PresentationCore\3.0.0.0__31bf3856ad364e35\PresentationCore.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'First_Gui_Test_001.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\WindowsBase\3.0.0.0__31bf3856ad364e35\WindowsBase.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'First_Gui_Test_001.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Core\3.5.0.0__b77a5c561934e089\System.Core.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'First_Gui_Test_001.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_32\System.Printing\3.0.0.0__31bf3856ad364e35\System.Printing.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'First_Gui_Test_001.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Xml.Linq\3.5.0.0__b77a5c561934e089\System.Xml.Linq.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'First_Gui_Test_001.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Data.DataSetExtensions\3.5.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'First_Gui_Test_001.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'First_Gui_Test_001.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Deployment\2.0.0.0__b03f5f7f11d50a3a\System.Deployment.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'First_Gui_Test_001.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'First_Gui_Test_001.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\UIAutomationTypes\3.0.0.0__31bf3856ad364e35\UIAutomationTypes.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

The thread '<No Name>' (0xd0) has exited with code 0 (0x0).

'First_Gui_Test_001.vshost.exe' (Managed): Loaded 'C:\Documents and Settings\luis.tirado\My Documents\Visual Studio 2008\Projects\UI TEST\First_Gui_Test_001\First_Gui_Test_001\bin\Debug\First_Gui_Test_001.exe', Symbols loaded.

'First_Gui_Test_001.vshost.exe' (Managed): Loaded 'C:\Documents and Settings\luis.tirado\My Documents\Visual Studio 2008\Projects\UI TEST\First_Gui_Test_001\First_Gui_Test_001\bin\Debug\Core.dll'

'First_Gui_Test_001.vshost.exe' (Managed): Loaded 'C:\Documents and Settings\luis.tirado\My Documents\Visual Studio 2008\Projects\UI TEST\First_Gui_Test_001\First_Gui_Test_001\bin\Debug\Bricks.RuntimeFramework.dll'

'First_Gui_Test_001.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\UIAutomationClient\3.0.0.0__31bf3856ad364e35\UIAutomationClient.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'First_Gui_Test_001.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\UIAutomationProvider\3.0.0.0__31bf3856ad364e35\UIAutomationProvider.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'First_Gui_Test_001.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\UIAutomationClientsideProviders\3.0.0.0__31bf3856ad364e35\UIAutomationClientsideProviders.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'First_Gui_Test_001.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Accessibility\2.0.0.0__b03f5f7f11d50a3a\Accessibility.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'First_Gui_Test_001.vshost.exe' (Managed): Loaded 'C:\Documents and Settings\luis.tirado\My Documents\Visual Studio 2008\Projects\UI TEST\First_Gui_Test_001\First_Gui_Test_001\bin\Debug\Bricks.dll'

'First_Gui_Test_001.vshost.exe' (Managed): Loaded 'C:\Documents and Settings\luis.tirado\My Documents\Visual Studio 2008\Projects\UI TEST\First_Gui_Test_001\First_Gui_Test_001\bin\Debug\Castle.Core.dll'

'First_Gui_Test_001.vshost.exe' (Managed): Loaded 'C:\Documents and Settings\luis.tirado\My Documents\Visual Studio 2008\Projects\UI TEST\First_Gui_Test_001\First_Gui_Test_001\bin\Debug\Castle.DynamicProxy2.dll'

'First_Gui_Test_001.vshost.exe' (Managed): Loaded 'DynamicProxyGenAssembly2'

'First_Gui_Test_001.vshost.exe' (Managed): Loaded 'DynamicProxyGenAssembly2'

'First_Gui_Test_001.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_32\ISymWrapper\2.0.0.0__b03f5f7f11d50a3a\ISymWrapper.dll'

Section: Bricks in SectionGroup: Bricks is not configured in Configuration file

Using RecheckDurationInMilliseconds=100 for Bricks/Bricks

'First_Gui_Test_001.vshost.exe' (Managed): Loaded 'C:\Documents and Settings\luis.tirado\My Documents\Visual Studio 2008\Projects\UI TEST\First_Gui_Test_001\First_Gui_Test_001\bin\Debug\log4net.dll'

'First_Gui_Test_001.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'First_Gui_Test_001.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Runtime.Remoting\2.0.0.0__b77a5c561934e089\System.Runtime.Remoting.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'First_Gui_Test_001.vshost.exe' (Managed): Loaded 'DynamicProxyGenAssembly2'

'First_Gui_Test_001.vshost.exe' (Managed): Loaded 'DynamicProxyGenAssembly2'

The program '[1072] First_Gui_Test_001.vshost.exe: Managed' has exited with code 0 (0x0

 


 

Coordinator
Aug 11, 2008 at 6:54 PM
You have sent me the log output by debugging the application I think. What I need you do is to call window.LogStructure() or window2.LogStructure() [depending on where is your textbox]. You should have configured log4net correctly for getting this output.