cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to run a data loop with keyword tests inside the loop?

SOLVED
Highlighted
Occasional Contributor

Is it possible to run a data loop with keyword tests inside the loop?

I want to run a data loop to test the same actions but in two different websites. However, when I make the data loop, my keyword tests are not included in the loop.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Hero

Re: Is it possible to run a data loop with keyword tests inside the loop?

OK... what I would do is this:

 

1) Step one in your data driven loop is to set a project level variable to equal the URL that you get from the loop data.

2) Then, in your different keyword tests, whenever you need to reference the URL, use that project level variable.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

View solution in original post

11 REPLIES 11
Highlighted
Community Hero

Re: Is it possible to run a data loop with keyword tests inside the loop?

Short answer: Yes.

 

Pleased describe how you implemented your data loop so we can help debug what's going on.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Highlighted
Community Hero

Re: Is it possible to run a data loop with keyword tests inside the loop?

Show us a screenshot of your code for the loop if you can.  Sounds like something might be indented wrong and that will mess  your loop up bad.

Highlighted
Occasional Contributor

Re: Is it possible to run a data loop with keyword tests inside the loop?

I have a keyword test that logs into a website and I have a data loop that changes the URL. I then put in a couple of keywords tests that interact with the website, however, the loop just does the login and doesn't loop that actions for both websites.

Highlighted
Community Hero

Re: Is it possible to run a data loop with keyword tests inside the loop?

Can we see the code please?  This high level doesn't really help us help you.

Highlighted
Occasional Contributor

Re: Is it possible to run a data loop with keyword tests inside the loop?

I have considered just making another keyword test, and doing the loop there, but whenever I make a data loop, I cannot have the table as an input for the login because its a keyword test.

Highlighted
Occasional Contributor

Re: Is it possible to run a data loop with keyword tests inside the loop?

Heres my code for the login

Highlighted
Community Hero

Re: Is it possible to run a data loop with keyword tests inside the loop?

OK... what I would do is this:

 

1) Step one in your data driven loop is to set a project level variable to equal the URL that you get from the loop data.

2) Then, in your different keyword tests, whenever you need to reference the URL, use that project level variable.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

View solution in original post

Highlighted
Occasional Contributor

Re: Is it possible to run a data loop with keyword tests inside the loop?

Do I do all of this within a keyword test or withing the suite?

Highlighted
Community Hero

Re: Is it possible to run a data loop with keyword tests inside the loop?

Project level.  That way it will be available for all keyword tests.  You can go suite level but you don't need to here.

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors