SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 8 of 8
  1. #1
    Junior Member
    Join Date
    Jun 2005
    Posts
    14
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Selecting options from a web page

    Hello all...

    I was wondering if somebody could help me out with an issue I'm working on: I'm testing a web based application and I need to be able to enhance my script so that I can detect whether or not what is returned on the page is what I expect. For example, if you submit a form on the page, the next page gives you a list of options to select in the form of radio buttons. Sometimes there are no options available, and then an appropriate message is displayed.

    I know I need an IF/ELSE statement, but how do I get loadrunner to recognize that options are available, and if so, make a random selection and hit the next button?

    Thanks for your help!

  2. #2
    Moderator
    Join Date
    Aug 2001
    Location
    NC
    Posts
    6,018
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: Selecting options from a web page

    Two choices, web_reg_find() for existence or web_reg_save_param() for content or state. Either will work in this case depending upon how to code the solution.
    James Pulley

    Replace ineffective offshore contracts, LoadRunnerByTheHour. Starting @ $19.95/hr USD.

    Put us to the test, skilled expertise is less expensive than you might imagine.

    Twitter: @LoadRunnerBTH @PerfBytes

  3. #3
    Junior Member
    Join Date
    Jun 2005
    Posts
    14
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Selecting options from a web page

    Thanks, Pulley. Some questions:

    -As I understand the web_reg_find() functionality, it is to verify text on a page. when you say that web_reg_save_param() is for content or state, isn't content similar to text?

    -How can I instruct LR to make the appropriate selection?

    Thanks!

  4. #4
    Moderator
    Join Date
    Aug 2001
    Location
    NC
    Posts
    6,018
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: Selecting options from a web page

    You can user either one. It depends upon your programming preference. HTML files and the HTTP stream is TEXT, so you can look for object references embedded in the HTML file just as well as regular tags.
    James Pulley

    Replace ineffective offshore contracts, LoadRunnerByTheHour. Starting @ $19.95/hr USD.

    Put us to the test, skilled expertise is less expensive than you might imagine.

    Twitter: @LoadRunnerBTH @PerfBytes

  5. #5
    Junior Member
    Join Date
    Jun 2005
    Posts
    14
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Selecting options from a web page

    So I added the web_reg_save_param() function and ran a preliminary test to make sure it passed, and it did. However, I want to store all products/options returned in an array and have LR choose any one of those products. The help file says to use the "ORD=ALL" for handling arrays in a web_reg_save_param() function. I did this and didn't see much difference. I'm surely missing something but I'm not quite certain what it is.

  6. #6
    Moderator
    Join Date
    Aug 2001
    Location
    NC
    Posts
    6,018
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: Selecting options from a web page

    You're almost there. Keep going down that path. Think random numbers and arrays. Tighten up your left adn right boundary conditions to get your data content and not just the object existence. Don;t forget, sprintf() is the swiss army knife of string processing.
    James Pulley

    Replace ineffective offshore contracts, LoadRunnerByTheHour. Starting @ $19.95/hr USD.

    Put us to the test, skilled expertise is less expensive than you might imagine.

    Twitter: @LoadRunnerBTH @PerfBytes

  7. #7
    Junior Member
    Join Date
    Jun 2005
    Posts
    14
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Selecting options from a web page

    Okay, so I've got my web_reg_save_param() and sprintf() in there. My web_reg function is before the web_submit. Should the sprintf() be before as well?

    Also, when I initially recorded the script, I selected a particular value (radio button selection) then confirmed the order. When I ammend the script to include the new functions, what happens with this existing part of the script? Does it need to be removed or commented out? I no longer what that exact value, but rather a specified alternative value.

    Thanks for all your help thus far James. I really appreciate it!!

  8. #8
    Moderator
    Join Date
    Aug 2001
    Location
    NC
    Posts
    6,018
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: Selecting options from a web page

    Here's the pcode:

    Register_parameter()
    Make_HTTP_call()
    Check_4_#_of_elements_in_the_parameter_array()
    Calculate_random_number_between_1_and_limit()
    Assign_new_LR_variable_value_from_correlated_param eter_array[random_offset]()
    .....
    Reference_new_LR_Variable_in_following_HTTP_call()
    James Pulley

    Replace ineffective offshore contracts, LoadRunnerByTheHour. Starting @ $19.95/hr USD.

    Put us to the test, skilled expertise is less expensive than you might imagine.

    Twitter: @LoadRunnerBTH @PerfBytes

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 08:27 AM.

Copyright BetaSoft Inc.