Page 1 of 1

BDD with Ranorex

Posted: Fri Mar 17, 2017 12:10 pm
by bk_tester
Hi Support Team,

Is it possible to create BDD tests in Ranorex Studio? If so are there any information about this?

I've checked http://www.ranorex.com/forum/bdd-gherki ... t2802.html this post but link mentioned there is not already available.

Thanks,
Bohdan

Re: BDD with Ranorex

Posted: Fri Mar 17, 2017 12:14 pm
by odklizec
Hi,

I'm afraid, I don't know anything about BDD, but you can view the post from provided link via Internet archive:
https://web.archive.org/web/20120126123 ... t-ranorex/?

Re: BDD with Ranorex

Posted: Fri Mar 17, 2017 3:27 pm
by bk_tester
Thank you for the replay!

This article is about using Ranorex dlls in conjusction with SpecFlow libraries in a typical IDE. Is there any way to add SpecFlow to the RanorexStudio solution?

Regards

Re: BDD with Ranorex

Posted: Fri Mar 17, 2017 4:28 pm
by odklizec
I don't think so. Using libs and some code is the only way so far.

Re: BDD with Ranorex

Posted: Fri Mar 17, 2017 4:36 pm
by bk_tester
As far as Ranorex Studio do not have AddIn Manager included, how to add SpecFlow plugin to the Ranorex Studio?

Thanks

Re: BDD with Ranorex

Posted: Fri Mar 17, 2017 5:40 pm
by krstcs
That is what Pavel meant, you cannot add it in Ranorex Studio directly. You will have to add the DLL in the project's references and then add it as an include in each file/class you want to use it in. This will have to be done through code.

Re: BDD with Ranorex

Posted: Wed Mar 22, 2017 12:58 pm
by bk_tester
I'm familiar with that ability of SharpDevelop Studio to include external libraries. I've asked about adding required plugin, if it's not possible... Therefore thanks for the answers.

Re: BDD with Ranorex

Posted: Wed Mar 22, 2017 3:41 pm
by Vaughan.Douglas
bk_tester wrote:I'm familiar with that ability of SharpDevelop Studio to include external libraries. I've asked about adding required plugin, if it's not possible... Therefore thanks for the answers.
I was tasked with determining the feasibility of doing just such a thing and I'll tell you the same thing I told them.

No it is not possible to legitimately get the necessary SpecFlow plugin added to the Ranorex IDE. The underlying IDE (SharpDevelop) does allow plugins but the Ranorex distribution does not. That being said, if you look hard enough you will uncover ways to hack and slash plugins into Ranorex but I would EXTREMELY reluctant in doing so. You would be off the reservation using an unsupported version of Ranorex.

Furthermore... what are you looking to gain from incorporating SpecFlow into Ranorex? They are fundamentally incompatible frameworks. SpecFlow is an implementation of Cucumber which executes tests based on the text of a requirement. Ranorex executes tests according to a flow in a test suite. You're not going to be able to create a test suite based on a Gherkin document that executes individual modules. You could drop a feature request and they'll look at it. I think there could be some benefits to a BDD implementation in Ranorex that, for example, would allow users to execute a Cucumber like feature file that leverages the Ranorex object identification functionality.... which is why I looked into it in the first place.

Re: BDD with Ranorex

Posted: Wed Mar 22, 2017 4:32 pm
by Vaughan.Douglas
I just stumbled across a request over at uservoice to add BDD functionality into Ranorex. You can vote for it here

Re: BDD with Ranorex

Posted: Thu Aug 24, 2017 4:21 pm
by Tomsk666
A client of our asked about BDD with Ranorex, which is possible but outside Ranorex Studio, using MS Visual Development Studio instead.
Here is a link to the webinar we had with them to show them how it can be done, using MS VS, SpecFlow, NUnit & Ranorex - https://www.edgewordstraining.co.uk/201 ... d-ranorex/

As said earlier, it would be great if SpecFlow could be added to Ranorex Studio, but I guess would take some work on SpecFlow's side due to Ranorex using SharpDevelop?
Also, as mentioned on the video - using a framework like BDD, you lose many of Ranorex's great features - Record & Reply, Object Repositories, Modules, simple data-driven testing. This also means that script maintenance will be higher as elements will be described multiple times potentially, using the RanoreXPath in code instead of ORs.

Re: BDD with Ranorex

Posted: Mon Feb 12, 2018 12:17 pm
by WorkFlo
Hi,
are the answers here still up-to-date, i.e. the request at uservoice not (yet) implemented?

The way I see it, Ranorex does not directly support BDD via Gherkin. I would have my .feature file saying
When the user clicks the "OK" button

and use e.g. SpecFlow to translate it into

[When(@"the user clicks the ""(.*)"" button")]
public static void ClickStart(string p0)
{
//run a ranorex script that clicks a button, passing p0 as argument
}

This translation from a .feature file into step definitions can not be done within Ranorex, so the step definition has no access to how Ranorex is representing UI objects.

Did I get this right?

Re: BDD with Ranorex

Posted: Tue Feb 13, 2018 10:13 am
by Tomsk666
Yes, the information is still up to date. SpecFlow is only available for Visual Studio.
So if you want to use Ranorex with BDD (using a tool such as SpecFlow), you have to do this in Visual Studio, where you can then use the Ranorex API.
For a video example of how to do this, see:
Updated Link for Ranorex 8 https://www.edgewordstraining.co.uk/201 ... 17-part-1/
The draw back is that you do not have access to the Object Repositories any more, meaning Object Identification is done using the RanoreXPath in code, which is harder to maintain.