I'm automating my desktop application but I got stucked in this part. I need to avaliate itens in that application clicking on "Sim" e "Não" (Yes and No) buttons. Thoose buttons are pictureboxes. Here is the xml from this part.
<Pane AcceleratorKey="" AccessKey="" AutomationId="597776" ClassName="WindowsForms10.Window.8.app.0.83dd9_r9_ad1" FrameworkId="WinForm" HasKeyboardFocus="False" HelpText="" IsContentElement="True" IsControlElement="True" IsEnabled="True" IsKeyboardFocusable="True" IsOffscreen="False" IsPassword="False" IsRequiredForForm="False" ItemStatus="" ItemType="" LocalizedControlType="painel" Name="Requi" Orientation="None" ProcessId="7700" RuntimeId="42.597776" x="1526" y="264" width="355" height="125">
<Pane AcceleratorKey="" AccessKey="" AutomationId="Txo" ClassName="WindowsForms10.Window.8.app.0.83dd9_r9_ad1" FrameworkId="WinForm" HasKeyboardFocus="False" HelpText="" IsContentElement="True" IsControlElement="True" IsEnabled="True" IsKeyboardFocusable="True" IsOffscreen="False" IsPassword="False" IsRequiredForForm="False" ItemStatus="" ItemType="" LocalizedControlType="painel" Name="Requi" Orientation="None" ProcessId="7700" RuntimeId="42.597938" x="1526" y="264" width="355" height="125">
<Pane AcceleratorKey="" AccessKey="" AutomationId="tlpMain" ClassName="WindowsForms10.Window.8.app.0.83dd9_r9_ad1" FrameworkId="WinForm" HasKeyboardFocus="False" HelpText="" IsContentElement="True" IsControlElement="True" IsEnabled="True" IsKeyboardFocusable="True" IsOffscreen="False" IsPassword="False" IsRequiredForForm="False" ItemStatus="" ItemType="" LocalizedControlType="painel" Name="" Orientation="None" ProcessId="7700" RuntimeId="42.532546" x="1526" y="264" width="355" height="125">
<Pane AcceleratorKey="" AccessKey="" AutomationId="pnlTitle" ClassName="WindowsForms10.Window.8.app.0.83dd9_r9_ad1" FrameworkId="WinForm" HasKeyboardFocus="False" HelpText="" IsContentElement="True" IsControlElement="True" IsEnabled="True" IsKeyboardFocusable="True" IsOffscreen="False" IsPassword="False" IsRequiredForForm="False" ItemStatus="" ItemType="" LocalizedControlType="painel" Name="" Orientation="None" ProcessId="7700" RuntimeId="42.535706" x="1541" y="264" width="325" height="25">
<Text AcceleratorKey="" AccessKey="" AutomationId="lblTitleItem" ClassName="WindowsForms10.STATIC.app.0.83dd9_r9_ad1" FrameworkId="WinForm" HasKeyboardFocus="False" HelpText="" IsContentElement="True" IsControlElement="True" IsEnabled="True" IsKeyboardFocusable="False" IsOffscreen="False" IsPassword="False" IsRequiredForForm="False" ItemStatus="" ItemType="" LocalizedControlType="text" Name="Txo" Orientation="None" ProcessId="7700" RuntimeId="42.469970" x="1541" y="264" width="95" height="20" />
</Pane>
<Pane AcceleratorKey="" AccessKey="" AutomationId="pnlComentario" ClassName="WindowsForms10.Window.8.app.0.83dd9_r9_ad1" FrameworkId="WinForm" HasKeyboardFocus="False" HelpText="" IsContentElement="True" IsControlElement="True" IsEnabled="True" IsKeyboardFocusable="True" IsOffscreen="False" IsPassword="False" IsRequiredForForm="False" ItemStatus="" ItemType="" LocalizedControlType="painel" Name="selecionado" Orientation="None" ProcessId="7700" RuntimeId="42.1314788" x="1544" y="380" width="319" height="1" />
<Pane AcceleratorKey="" AccessKey="" AutomationId="tlpFluxoBtns" ClassName="WindowsForms10.Window.8.app.0.83dd9_r9_ad1" FrameworkId="WinForm" HasKeyboardFocus="False" HelpText="" IsContentElement="True" IsControlElement="True" IsEnabled="True" IsKeyboardFocusable="True" IsOffscreen="False" IsPassword="False" IsRequiredForForm="False" ItemStatus="" ItemType="" LocalizedControlType="painel" Name="Txo" Orientation="None" ProcessId="7700" RuntimeId="42.531754" x="1541" y="289" width="325" height="88">
<Pane AcceleratorKey="" AccessKey="" AutomationId="pnlSeparator4" ClassName="WindowsForms10.Window.8.app.0.83dd9_r9_ad1" FrameworkId="WinForm" HasKeyboardFocus="False" HelpText="" IsContentElement="True" IsControlElement="True" IsEnabled="True" IsKeyboardFocusable="True" IsOffscreen="False" IsPassword="False" IsRequiredForForm="False" ItemStatus="" ItemType="" LocalizedControlType="painel" Name="" Orientation="None" ProcessId="7700" RuntimeId="42.532058" x="1784" y="328" width="8" height="1" />
<Pane AcceleratorKey="" AccessKey="" AutomationId="pnlSeparator3" ClassName="WindowsForms10.Window.8.app.0.83dd9_r9_ad1" FrameworkId="WinForm" HasKeyboardFocus="False" HelpText="" IsContentElement="True" IsControlElement="True" IsEnabled="True" IsKeyboardFocusable="True" IsOffscreen="False" IsPassword="False" IsRequiredForForm="False" ItemStatus="" ItemType="" LocalizedControlType="painel" Name="" Orientation="None" ProcessId="7700" RuntimeId="42.793038" x="1733" y="328" width="8" height="1" />
<Pane AcceleratorKey="" AccessKey="" AutomationId="pnlSeparator2" ClassName="WindowsForms10.Window.8.app.0.83dd9_r9_ad1" FrameworkId="WinForm" HasKeyboardFocus="False" HelpText="" IsContentElement="True" IsControlElement="True" IsEnabled="True" IsKeyboardFocusable="True" IsOffscreen="False" IsPassword="False" IsRequiredForForm="False" ItemStatus="" ItemType="" LocalizedControlType="painel" Name="" Orientation="None" ProcessId="7700" RuntimeId="42.990874" x="1662" y="328" width="27" height="1" />
<Pane AcceleratorKey="" AccessKey="" AutomationId="picBoxAutomatico" ClassName="WindowsForms10.Window.8.app.0.83dd9_r9_ad1" FrameworkId="WinForm" HasKeyboardFocus="False" HelpText="" IsContentElement="True" IsControlElement="True" IsEnabled="True" IsKeyboardFocusable="True" IsOffscreen="False" IsPassword="False" IsRequiredForForm="False" ItemStatus="" ItemType="" LocalizedControlType="painel" Name="Txo" Orientation="None" ProcessId="7700" RuntimeId="42.663288" x="1563" y="307" width="45" height="44" />
<Pane AcceleratorKey="" AccessKey="" AutomationId="picBoxNP" ClassName="WindowsForms10.Window.8.app.0.83dd9_r9_ad1" FrameworkId="WinForm" HasKeyboardFocus="False" HelpText="" IsContentElement="True" IsControlElement="True" IsEnabled="True" IsKeyboardFocusable="True" IsOffscreen="False" IsPassword="False" IsRequiredForForm="False" ItemStatus="" ItemType="" LocalizedControlType="painel" Name="" Orientation="None" ProcessId="7700" RuntimeId="42.532350" x="1792" y="307" width="43" height="44" />
<Pane AcceleratorKey="" AccessKey="" AutomationId="picBoxNao" ClassName="WindowsForms10.Window.8.app.0.83dd9_r9_ad1" FrameworkId="WinForm" HasKeyboardFocus="False" HelpText="" IsContentElement="True" IsControlElement="True" IsEnabled="True" IsKeyboardFocusable="True" IsOffscreen="False" IsPassword="False" IsRequiredForForm="False" ItemStatus="" ItemType="" LocalizedControlType="painel" Name="" Orientation="None" ProcessId="7700" RuntimeId="42.598804" x="1741" y="307" width="43" height="44" />
<Pane AcceleratorKey="" AccessKey="" AutomationId="picBoxSim" ClassName="WindowsForms10.Window.8.app.0.83dd9_r9_ad1" FrameworkId="WinForm" HasKeyboardFocus="False" HelpText="" IsContentElement="True" IsControlElement="True" IsEnabled="True" IsKeyboardFocusable="True" IsOffscreen="False" IsPassword="False" IsRequiredForForm="False" ItemStatus="" ItemType="" LocalizedControlType="painel" Name="" Orientation="None" ProcessId="7700" RuntimeId="42.663220" x="1689" y="307" width="44" height="44" />
<Pane AcceleratorKey="" AccessKey="" AutomationId="picBoxSeta" ClassName="WindowsForms10.Window.8.app.0.83dd9_r9_ad1" FrameworkId="WinForm" HasKeyboardFocus="False" HelpText="" IsContentElement="True" IsControlElement="True" IsEnabled="True" IsKeyboardFocusable="True" IsOffscreen="False" IsPassword="False" IsRequiredForForm="False" ItemStatus="" ItemType="" LocalizedControlType="painel" Name="" Orientation="None" ProcessId="7700" RuntimeId="42.598552" x="1635" y="307" width="27" height="44" />
<Pane AcceleratorKey="" AccessKey="" AutomationId="pnlSeparator1" ClassName="WindowsForms10.Window.8.app.0.83dd9_r9_ad1" FrameworkId="WinForm" HasKeyboardFocus="False" HelpText="" IsContentElement="True" IsControlElement="True" IsEnabled="True" IsKeyboardFocusable="True" IsOffscreen="False" IsPassword="False" IsRequiredForForm="False" ItemStatus="" ItemType="" LocalizedControlType="painel" Name="" Orientation="None" ProcessId="7700" RuntimeId="42.599048" x="1608" y="328" width="27" height="1" />
<Text AcceleratorKey="" AccessKey="" AutomationId="lblSelecionado" ClassName="WindowsForms10.STATIC.app.0.83dd9_r9_ad1" FrameworkId="WinForm" HasKeyboardFocus="False" HelpText="" IsContentElement="True" IsControlElement="True" IsEnabled="True" IsKeyboardFocusable="False" IsOffscreen="False" IsPassword="False" IsRequiredForForm="False" ItemStatus="" ItemType="" LocalizedControlType="text" Name="selecionado" Orientation="None" ProcessId="7700" RuntimeId="42.664166" x="1689" y="290" width="147" height="15" />
<CheckBox AcceleratorKey="" AccessKey="" AutomationId="chkBoxAdicionarComentario" ClassName="WindowsForms10.BUTTON.app.0.83dd9_r9_ad1" FrameworkId="WinForm" HasKeyboardFocus="False" HelpText="" IsContentElement="True" IsControlElement="True" IsEnabled="True" IsKeyboardFocusable="True" IsOffscreen="False" IsPassword="False" IsRequiredForForm="False" ItemStatus="" ItemType="" LocalizedControlType="caixa de seleção" Name="Adicionar Comentário" Orientation="None" ProcessId="7700" RuntimeId="42.600486" x="1692" y="354" width="171" height="20" ToggleState="Off" IsAvailable="True" />
<Text AcceleratorKey="" AccessKey="" AutomationId="lblAutomatico" ClassName="WindowsForms10.STATIC.app.0.83dd9_r9_ad1" FrameworkId="WinForm" HasKeyboardFocus="False" HelpText="" IsContentElement="True" IsControlElement="True" IsEnabled="True" IsKeyboardFocusable="False" IsOffscreen="False" IsPassword="False" IsRequiredForForm="False" ItemStatus="" ItemType="" LocalizedControlType="text" Name="automático" Orientation="None" ProcessId="7700" RuntimeId="42.598118" x="1541" y="290" width="94" height="15" />
</Pane>
</Pane>
</Pane>
</Pane>
I need to click on AutomationId="picBoxSim" from AutomationId="Txo"(Txo is one of the avaliable itens, there is a lot more. The same XML only changing the AutomationId="Txo" to AutomationId="something"; I've tried a few codes but nothing seems to work.
Like this one:
Driver.Session.FindElementByXPath("//Pane[@AutomationId='Txo']").FindElementByXPath("//Pane[@AutomationId='picBoxSim']").Click();