Ranorex 7: Equivalent to WebDocument

Best practices, code snippets for common functionality, examples, and guidelines.
SteveO_za
Posts: 4
Joined: Tue Apr 25, 2017 4:55 pm

Ranorex 7: Equivalent to WebDocument

Post by SteveO_za » Tue Apr 25, 2017 5:09 pm

Hi

I'm trying to do some basic Java injection.
Using an example from a previous post:

Host.Local.OpenBrowser("anActualURL", "Chrome", "", false, false);
WebDocument webDocument = @"/dom[@domain='anActualURL' and @caption='Test Automation Tools - Ranorex Automation Framework']";
webDocument.ExecuteScript("document.write('Hello World!');");

(sorry can't put in a URL - new accounts are not allowed - but it's Ranorex's)

This requires a few of the plugins (Ranorex.Plugin.Web, Ranorex.Plugin.Msaa, etc) from Ranorex 6 to work although the OpenBrowser is also missing a few default plugins...

How would I now do something similiar using Ranorex 7?

Thanks
Steve

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Ranorex 7: Equivalent to WebDocument

Post by krstcs » Wed Apr 26, 2017 1:24 pm

Ranorex 7 should work the same as 6 in this instance. You should see no difference.

Is there something in particular that you are having problems with? Is an error being thrown when you try it in 7?
Shortcuts usually aren't...

SteveO_za
Posts: 4
Joined: Tue Apr 25, 2017 4:55 pm

Re: Ranorex 7: Equivalent to WebDocument

Post by SteveO_za » Wed Apr 26, 2017 4:49 pm

I found the issue.
Totally my fault, I reference Ranorex from within my Visual Studio project (add reference to the DLL's)
I was pulling the wrong DLL's

I was using the DLL's from:
C:\Program Files (x86)\Ranorex 7.0\RanorexStudio\bin
instead of
C:\Program Files (x86)\Ranorex 7.0\Bin

Of course it all works fine now...