Highlight Element with API : Automation API

Highlight Element with API

Class library usage, coding and language questions.

Highlight Element with API

Postby Patrik » Thu Sep 15, 2011 10:37 am

Hello,

is it possible to highlight an element on the application under test with the API ?!
I have the Adapter object and the Element object --- also the RxPath of the Element and now i want to highlight it on the application... something like: element.highlight();

Thanks in advance,
Patrik
Patrik
 
Posts: 13
Joined: Fri Sep 02, 2011 3:56 pm

Re: Highlight Element with API

Postby Support Team » Thu Sep 15, 2011 1:41 pm

Hi,

basically Ranorex can only present information which is provided by its UI adapters during test execution.
It depends on the technology underlying your application under test if you can set/get more information (as provided directly via accessibility) out of the adapter. If you application is based on WinForms you can try to use the Get/SetPropertyValue methods.
For more details have a look at Ranorex GUI Adapter.
If you use a web based technology you may use the GetStyle/SetStyle methods to change the view of the element.
There are also some samples: http://www.ranorex.com/support/user-guide-20/web-testing/samples.html
If you want to use the Ranorex internal "highlighter" you have to add the "Ranorex.Controls" assembly as reference and these lines of code, but this is not really recommended and a Ranorex internal method:
Highlighter highLighter = new Highlighter();
      Button buttonStart = "/dom[@domain='www.ranorex.com' and @page='FlexExample.html']/body/flexobject/button[@id='button1']";
      highLighter.Hide();
      highLighter.UpdateFromElement(buttonStart);
      highLighter.Show(5000);


Kind Regards,
Markus
Ranorex Support Team
User avatar
Support Team
Site Admin
 
Posts: 4843
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: Highlight Element with API

Postby Patrik » Fri Sep 16, 2011 8:31 am

PERFECT - this was exactly what i need :)
Thanks a lot, best regards,
Patrik
Patrik
 
Posts: 13
Joined: Fri Sep 02, 2011 3:56 pm


Return to Automation API

Who is online

Users browsing this forum: No registered users and 0 guests