Test Republic

Community of Software Testing Professionals

Hiya All

I've been playing with the idea of extending a test case by having it use an array to call data that essentially 're-uses' the test case. To do this however I need a way to combine Ruby script with Selenium Commands.

The basic loop works fine as you can see here:


However the idea is to wrap the test case with this loop, avoid having to repeat the set of steps multiple times within the case with hard coded strings such as "Software - Google Search" and instead use strings pulled from the array. So it looks like this:


It all seems to work well except for the fact the string used isn't changing. When the script runs it cycles through four times but only uses the first array item of 'software'. This is re-used for every loop through the test.

As you can see from the images I've moved some variables both before the While Loop and within it, i also tried using a begin...end while structure and the effect was roughly the same.

* Can anyone suggest why this would be?
* Why is it that the testLoop value is not getting picked up and/or used?

Both the sample loop and DDT script are attached in case you want to look at them.

Thanks again,

Mark.

Tags: data, ruby, selenium

Attachments:

Reply to This

Replies to This Discussion

Mark,

I am not good at either of these - Ruby - Selenium. However forwarded this link to a (closed) group of people whom I know might be of help to you since they work on this. If they get back to you or reply here, I will be glad, they opened up.

Reply to This

Hiya Pradeep / All,

The solution to this one comes via feedback from those in the field plus some tweaking.


The final script is also attached in case folks find it of use.

Onto the next problem! :)

Mark.
Attachments:

Reply to This

RSS

Test Republic Elsewhere

 /></a></p> <p style=

Members

  • Daniel
  • Shiva Kumar
  • Raghavendra NK
  • jagan
  • P.K.Ramya
  • Sivakumar
  • Arun Kumar.V
  • Poornima Kadambi
  • Vijayalaxmi
  • Sreethin
  • Brian Osman
  • s kumar
  • Shreya
  • APARNA
  • Sanjeev Kumar Singh

© 2010   Created by EDISTA.

Badges  |  Report an Issue  |  Terms of Service