Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Random vs. Sequential access

This is a discussion on Random vs. Sequential access within the LoadRunner forums, part of the Software Testing category; Hi all! I would need help in the following topic: Let me have a File or Table type parameter calles myList (it looks like this: IDs 11 22 33 44 ...

Go Back   Geeks Talk > Software Testing > LoadRunner
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read
  #1 (permalink)  
Old 10-04-2007
Junior Member
 
Join Date: Oct 2007
Location: Hungary, Budapest
Posts: 16
Thanks: 1
Thanked 1 Time in 1 Post
PalEE is on a distinguished road
Random vs. Sequential access

Hi all!

I would need help in the following topic:

Let me have a File or Table type parameter calles myList
(it looks like this:
IDs
11
22
33
44
55
...)

What if I don't want to access the data every time Randomly? So for example I would need to get the first data in every iteration randomly, but in the same iteration I want the second data to get sequentally.

So for exemple the data what I want in 3 iterations:
22 and 33
66 and 77
11 and 22

How can I solve this problem?
I could ask the same same with other words:
- can I reach the data in the parameter files DIRECTLY
or
- can I switch the access type (random or seq.) of a parameter file during execution?

ps: of course the lr_next_row() and the lr_advance_param() funcions cannot be used for this, because these are using the initial type of the access. So if I have a random access, than these functions will give me the second data also randomly.

Thx for the help!
PalEE
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-04-2007
Contributing Member
 
Join Date: Sep 2007
Posts: 50
Thanks: 0
Thanked 2 Times in 2 Posts
SW_LoadRunnerGuru is on a distinguished road
Re: Random vs. Sequential access

Hi PalEE,

That is a good question. After looking through the function reference, I only see one function that may help you.
lr_next_row(char*);

Please try it out and let us know how you get this to work as I would like to know.

Thanks,
Reply With Quote
  #3 (permalink)  
Old 10-05-2007
Junior Member
 
Join Date: Oct 2007
Location: Hungary, Budapest
Posts: 16
Thanks: 1
Thanked 1 Time in 1 Post
PalEE is on a distinguished road
Re: Random vs. Sequential access

... yes, this is the good thing in this question, that (as I know) there is no evidential solution for it in the funtion reference. I also checked them

So...

For example, if I have a perameter file called "nums.dat" and it contains the data what I wrote before, than the next row function would be this:

lr_next_row("nums.dat");

But if the base access is random, then this function gives back the next RANDOM data. So for example the first one is the 33, and I would need here the 44, but the lr_next_row(...) gives back for example the 99.

The other similar function is the lr_advance_param(...). This does almost the same as the lr_next_row(...). The only difference is, that if U have a param file with many columns than the lr_advence_param(...) steps only one element (so for example to the next column), but the lr_next_row(...) steps to the next row (not only one element). But the problem is, that both of them do the step according to the base access type of the param file, and if it is a random access.... than the next element will also be a random one.

The funny is, that I saw a task from an official LoadRunner exam (example), where the base problem was this, what I wrote down.
I "can" solve this problem, but only with some restrictions and workarounds, but it is not what I want

So the question is still here... can I access directly to the parameters files? The best would be if I could say something like that:
char* lr_get_data( char* paramFileName, int rowNum, int columnNum)
And whit this I could reach the data directly.

Of course U can say, that lets code it in C.... but first of all I don't like C (ok, it is not true, but C is complicated ), and 2: during an exam U shouldn't start to write quite big C functions. If I'm not right, tell me!

Thanks for the help
(the Q. is already open)
Reply With Quote
  #4 (permalink)  
Old 10-05-2007
Contributing Member
 
Join Date: Sep 2007
Posts: 50
Thanks: 0
Thanked 2 Times in 2 Posts
SW_LoadRunnerGuru is on a distinguished road
Re: Random vs. Sequential access

Hi,

You are absolutely right, LoadRunner is supposed to supply all of the functionality that you need to create scripts using only it's API (or so they say )

I saw lr_advance_param(), and lr_next_row().....the function reference makes it seem like lr_next_row() does what you want it to do....that's too bad that it still uses the "SelectNextRow=Random".

If the data has the pattern that you are suggesting, you can always manually create a new parameter by converting the current parameter into an integer, adding 11 to it, and copying the next integer into a new parameter.

If not, then creating your own C code to do this is the only thing I can think of.
Reply With Quote
  #5 (permalink)  
Old 10-08-2007
Junior Member
 
Join Date: Oct 2007
Location: Hungary, Budapest
Posts: 16
Thanks: 1
Thanked 1 Time in 1 Post
PalEE is on a distinguished road
Re: Random vs. Sequential access

Of course this data file was just an example for easier understand.
So the solution is an own C function.

I have to mention, that this could be quite difficult to implement, if U wanna have the possibility what the original parameters have (for example random access).

Thx,
PalEE
Reply With Quote
Reply

  Geeks Talk > Software Testing > LoadRunner

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Access Boss is a great access management and time control utility that allows you to JobHelper Geeks Lounge 0 07-22-2007 05:40 AM
I want to create random value Geek_Guest VB.NET 1 07-07-2007 08:06 AM
Is there any other name for this Random testing Geek_Guest Testing Issues 4 05-22-2007 06:57 AM
Generate random password Using PHP fred PHP 2 02-06-2007 08:56 AM
Data Access Layer For Microsoft Access Lokesh M VB.NET 0 12-02-2006 11:35 AM


All times are GMT -4. The time now is 08:00 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved