Page 1 of 1

Best way to verify special characters, bold and italic text?

Posted: Mon Mar 12, 2012 7:35 pm
by Zhilll
I'm currently testing a Flex application using Ranorex. The application under test has similar functionality as a word processor and has features where users can bold and italicze text. Users can also add special characters such as the section symbol. I'm wondering if there is a way to verify if text is bold or italicized, or verify special characters?

Re: Best way to verify special characters, bold and italic text?

Posted: Tue Mar 13, 2012 1:25 pm
by Support Team
Hi,
I'm wondering if there is a way to verify if text is bold or italicized, or verify special characters?
That depends on your application, can you send us a Ranorex Snapshot file of your application when a document with such a bold, italic, ... text is shown?
Following link will show you how to generate a snapshot file:
http://www.ranorex.com/support/user-gui ... files.html
With these snapshot files we can have a closer look on the application/controls and their properties.

Regards,
Markus
Ranorex Support Team

Re: Best way to verify special characters, bold and italic text?

Posted: Fri Sep 14, 2012 5:56 am
by jmagaru.inforum
I have also the same problem, need to verify if the text is italic, bold or normal in wpf objects,
Hope you can also have some workarounds, except for image capturing, most of the text to validate are dynamic text.

Re: Best way to verify special characters, bold and italic text?

Posted: Fri Sep 14, 2012 3:48 pm
by Support Team
Hi,

In order to analyze the issue we would need a Ranorex snapshot file of these elements.
Following link will show you how to generate a snapshot file:
Creating Ranorex Snapshot Files.

Thanks,
Markus
Ranorex Support Team

Re: Best way to verify special characters, bold and italic text?

Posted: Fri Sep 14, 2012 7:30 pm
by Zhilll
here is a snapshot

Re: Best way to verify special characters, bold and italic text?

Posted: Mon Sep 17, 2012 2:57 pm
by Support Team
Hi,

Thanks for the snapshot!
This flex control was adapted with the new flex version(spark.components::TextArea) and since Adobe changed the way how the text is displayed we have to adapt the way how we get the information about the formatting string too and this is unfortunately with the current Ranorex version not yet possible.
It should be fixed with one of the next Ranorex versions, there should be an additional property (the name could be "HtmlText").

Regards,
Markus
Ranorex Support Team

Re: Best way to verify special characters, bold and italic text?

Posted: Mon Nov 18, 2013 11:36 am
by jmagaru.inforum
Sorry for late sending snapshot, hope there are workarounds on this issues

Re: Best way to verify special characters, bold and italic text?

Posted: Tue Nov 19, 2013 2:32 pm
by Support Team
Hi,

No problem ;).

Ranorex uses Microsoft UI Automation to identify WPF controls and since this accessibility (UI Automation) infrastructure only exposes a subset of control properties which is limiting in some cases. For example, there is unfortunately no easy way to validate the FontStyle.

One workaround that is possible in this case is to use the ItemStatus property of UI Automation. For example, in the below XAML snippet, just by adding the line (AutomationProperties.ItemStatus="{Binding RelativeSource={RelativeSource Self}, Path=FontStyle}"), the FontStyle of the TextBox is exposed as ItemStatus & can be validate using Ranorex now.
<TextBox Name="MyTextBox" HorizontalAlignment="Left" Height="24" Margin="182,53,0,0" TextWrapping="Wrap" Text="Red" FontStyle="Italic" VerticalAlignment="Top" Width="147"
AutomationProperties.ItemStatus="{Binding RelativeSource={RelativeSource Self}, Path=FontStyle}"/>
FontStyle.png
Regards,
Markus

Re: Best way to verify special characters, bold and italic text?

Posted: Wed Nov 20, 2013 8:03 am
by jmagaru.inforum
Thanks for the quick reply. But what file do I need to modify to put that workaround?

Re: Best way to verify special characters, bold and italic text?

Posted: Thu Nov 21, 2013 2:11 pm
by Support Team
Hi,

You're welcome!

You need to add the specific code to the XAML file where your control is defined.

Regards,
Markus