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

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
Zhilll
Posts: 13
Joined: Thu Oct 06, 2011 2:48 pm

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

Post by Zhilll » Mon Mar 12, 2012 7:35 pm

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?

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

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

Post by Support Team » Tue Mar 13, 2012 1:25 pm

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

User avatar
jmagaru.inforum
Posts: 3
Joined: Fri Sep 14, 2012 5:52 am
Contact:

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

Post by jmagaru.inforum » Fri Sep 14, 2012 5:56 am

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.
Jonathan L. Magaru
Software Quality Engineer - Automation

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

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

Post by Support Team » Fri Sep 14, 2012 3:48 pm

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

Zhilll
Posts: 13
Joined: Thu Oct 06, 2011 2:48 pm

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

Post by Zhilll » Fri Sep 14, 2012 7:30 pm

here is a snapshot
You do not have the required permissions to view the files attached to this post.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

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

Post by Support Team » Mon Sep 17, 2012 2:57 pm

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

User avatar
jmagaru.inforum
Posts: 3
Joined: Fri Sep 14, 2012 5:52 am
Contact:

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

Post by jmagaru.inforum » Mon Nov 18, 2013 11:36 am

Sorry for late sending snapshot, hope there are workarounds on this issues
You do not have the required permissions to view the files attached to this post.
Jonathan L. Magaru
Software Quality Engineer - Automation

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

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

Post by Support Team » Tue Nov 19, 2013 2:32 pm

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
You do not have the required permissions to view the files attached to this post.

User avatar
jmagaru.inforum
Posts: 3
Joined: Fri Sep 14, 2012 5:52 am
Contact:

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

Post by jmagaru.inforum » Wed Nov 20, 2013 8:03 am

Thanks for the quick reply. But what file do I need to modify to put that workaround?
Jonathan L. Magaru
Software Quality Engineer - Automation

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

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

Post by Support Team » Thu Nov 21, 2013 2:11 pm

Hi,

You're welcome!

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

Regards,
Markus