Hello,
Could you please send us the whole project?
Thank you!
Regards,
Bernhard
Recognizing elements on a TabControl
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Recognizing elements on a TabControl
Find attached the whole project.
You do not have the required permissions to view the files attached to this post.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Recognizing elements on a TabControl
Hello,
Thank you for the project. We will take a look at this issue and will get back to you as soon as possible.
Regards,
Bernhard
Thank you for the project. We will take a look at this issue and will get back to you as soon as possible.
Regards,
Bernhard
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Recognizing elements on a TabControl
Hello,
It seems to be an issue if the Target Framework setting is set to '.NET Framework 4.0'. I changed the setting to '.NET Framework 3.5'. After doing that, Spy was able to recognize the buttons inside the Tab Control.
Regards,
Bernhard
It seems to be an issue if the Target Framework setting is set to '.NET Framework 4.0'. I changed the setting to '.NET Framework 3.5'. After doing that, Spy was able to recognize the buttons inside the Tab Control.
Regards,
Bernhard
Re: Recognizing elements on a TabControl
I am able to see the controls following the suggestion at,
http://social.msdn.microsoft.com/forums ... 436E99797F
I created a custom peer and if I start my application and then start Ranorex SPY I can see the elements. If however I start Ranorex studio and then start the application I still can't see those items. It's not until a close Ranorex and kill the bridge process that I can then see the elements again in Spy.
This also means that my iUI test fails as it can't see my control.
http://social.msdn.microsoft.com/forums ... 436E99797F
I created a custom peer and if I start my application and then start Ranorex SPY I can see the elements. If however I start Ranorex studio and then start the application I still can't see those items. It's not until a close Ranorex and kill the bridge process that I can then see the elements again in Spy.
This also means that my iUI test fails as it can't see my control.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Recognizing elements on a TabControl
Hello,
It seems to be an issue in the .NET 4.0/4.5 version in relation to the 'Tab Control' template.
We changed your XAML code a bit. Please try the following one. The behavior of your application should be the same.
Regards,
Bernhard
It seems to be an issue in the .NET 4.0/4.5 version in relation to the 'Tab Control' template.
We changed your XAML code a bit. Please try the following one. The behavior of your application should be the same.
<TabControl BorderThickness="0" x:Name="UnseenTabControl" SelectedIndex="{Binding ElementName=SelectedPage, Path=SelectedItem}" OverridesDefaultStyle="False"> <TabControl.Resources> <Style TargetType="TabItem"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="TabItem"> </ControlTemplate> </Setter.Value> </Setter> </Style> </TabControl.Resources> <TabItem> <Grid> <Button Name="OnPage3">OnPage1</Button> </Grid> </TabItem> <TabItem> <Grid> <Button Name="OnPage4" Margin="20" AutomationProperties.AutomationId="ButtonUAID">OnPage2</Button> <Expander> <Button Name="InsideExpander2">InsideExpander2</Button> </Expander> </Grid> </TabItem> </TabControl>I hope this will help you!
Regards,
Bernhard
Re: Recognizing elements on a TabControl
Hello Bernhard,
I have also severe problems with having Ranorex and Ranorex Spy recognizing the controls of our application reliably and I did not know that this has probably something to do with prolems in TabControls in .NET4.0. Sometimes the contained controls are found and sometimes they are not found and are forgotten etc.. It is my misfortune that the whole application starts with a TabControl in a Grid and uses sub TabControls to navigate, i.e. it is an application founded on tab navigation and I have to test its GUI in an automated way with Ranorex . Your last post is a code suggestion to someone how to circumvent this problems. I don't know the code of the other user, so can you tell me which code you modified and why you modified it? If your modifications include the part with the style for the template (as shown below) then I must say that I cannot apply this modification to my code because it clips all the images in my tab items headers away and perhaps has other side effects too. So can you tell me what I can do?
I have also severe problems with having Ranorex and Ranorex Spy recognizing the controls of our application reliably and I did not know that this has probably something to do with prolems in TabControls in .NET4.0. Sometimes the contained controls are found and sometimes they are not found and are forgotten etc.. It is my misfortune that the whole application starts with a TabControl in a Grid and uses sub TabControls to navigate, i.e. it is an application founded on tab navigation and I have to test its GUI in an automated way with Ranorex . Your last post is a code suggestion to someone how to circumvent this problems. I don't know the code of the other user, so can you tell me which code you modified and why you modified it? If your modifications include the part with the style for the template (as shown below) then I must say that I cannot apply this modification to my code because it clips all the images in my tab items headers away and perhaps has other side effects too. So can you tell me what I can do?
Code: Select all
<TabControl.Resources>
<Style TargetType="TabItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TabItem">
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</TabControl.Resources>
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Recognizing elements on a TabControl
Hello,
In order to analyze your issue I would need more information. Could you please send us a Ranorex snapshot file of your application. If it is possible it would be very helpful to get your application or a similar application to reproduce this behavior. The original source of XAML code can be found on the first page of this thread (http://www.ranorex.com/forum/recognizin ... -t647.html).
Regards,
Bernahrd
In order to analyze your issue I would need more information. Could you please send us a Ranorex snapshot file of your application. If it is possible it would be very helpful to get your application or a similar application to reproduce this behavior. The original source of XAML code can be found on the first page of this thread (http://www.ranorex.com/forum/recognizin ... -t647.html).
Regards,
Bernahrd