BDD with Ranorex

Ask general questions here.
bk_tester
Posts: 26
Joined: Thu Dec 29, 2016 5:37 pm

BDD with Ranorex

Post by bk_tester » Fri Mar 17, 2017 12:10 pm

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

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3945
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: BDD with Ranorex

Post by odklizec » Fri Mar 17, 2017 12:14 pm

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/?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

bk_tester
Posts: 26
Joined: Thu Dec 29, 2016 5:37 pm

Re: BDD with Ranorex

Post by bk_tester » Fri Mar 17, 2017 3:27 pm

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

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3945
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: BDD with Ranorex

Post by odklizec » Fri Mar 17, 2017 4:28 pm

I don't think so. Using libs and some code is the only way so far.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

bk_tester
Posts: 26
Joined: Thu Dec 29, 2016 5:37 pm

Re: BDD with Ranorex

Post by bk_tester » Fri Mar 17, 2017 4:36 pm

As far as Ranorex Studio do not have AddIn Manager included, how to add SpecFlow plugin to the Ranorex Studio?

Thanks

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

Re: BDD with Ranorex

Post by krstcs » Fri Mar 17, 2017 5:40 pm

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.
Shortcuts usually aren't...

bk_tester
Posts: 26
Joined: Thu Dec 29, 2016 5:37 pm

Re: BDD with Ranorex

Post by bk_tester » Wed Mar 22, 2017 12:58 pm

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.

Vaughan.Douglas
Posts: 250
Joined: Tue Mar 24, 2015 5:05 pm
Location: Des Moines, Iowa, USA

Re: BDD with Ranorex

Post by Vaughan.Douglas » Wed Mar 22, 2017 3:41 pm

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.
Doug Vaughan

Vaughan.Douglas
Posts: 250
Joined: Tue Mar 24, 2015 5:05 pm
Location: Des Moines, Iowa, USA

Re: BDD with Ranorex

Post by Vaughan.Douglas » Wed Mar 22, 2017 4:32 pm

I just stumbled across a request over at uservoice to add BDD functionality into Ranorex. You can vote for it here
Doug Vaughan

Tomsk666
Certified Professional
Certified Professional
Posts: 33
Joined: Thu Mar 28, 2013 12:59 pm
Location: UK
Contact:

Re: BDD with Ranorex

Post by Tomsk666 » Thu Aug 24, 2017 4:21 pm

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.

WorkFlo
Posts: 1
Joined: Mon Feb 12, 2018 11:45 am

Re: BDD with Ranorex

Post by WorkFlo » Mon Feb 12, 2018 12:17 pm

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?

Tomsk666
Certified Professional
Certified Professional
Posts: 33
Joined: Thu Mar 28, 2013 12:59 pm
Location: UK
Contact:

Re: BDD with Ranorex

Post by Tomsk666 » Tue Feb 13, 2018 10:13 am

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.