Using Jmeter to fill out a form?

13,452

Solution 1

Google is not a good example because it uses GET for the form. For example, to search "jmeter" and press Feeling Lucky button, you can just send this URL,

http://www.google.com/search?hl=en&source=hp&q=jmeter&oq=&btnI=1

To do a real post, you need to find the form control field names from a trace or by looking at HTML source and just do something like showed here. The username/password are the field name to post. The action is http://www.example.com/login.

JMeter example

Solution 2

Please note the screen shot is wrong. The method is a "GET" and it should be set to "POST", otherwise the form will not be submitted properly.

Solution 3

Is there a reason why you want to load test Google? If you just want to have a script that tests the functionality of a Website, try selenium: http://seleniumhq.org/. If you are actually trying to load test a form, you have to create the appropriate request. Using a tool like Fiddler can help.

Share:
13,452
llaskin
Author by

llaskin

Updated on June 08, 2022

Comments

  • llaskin
    llaskin almost 2 years

    Can anyone help me figure out how to use jmeter and force it to fill out and submit a form automatically? For example, I need to fill out the google search box and then click the I'm Feeling Lucky button?

  • llaskin
    llaskin over 14 years
    I used google as an example since its similar to the form I am looking to test.
  • llaskin
    llaskin over 14 years
    thanks this is awesome. You are right after looking at it with Fiddler, google only does GET requests...I was confused when I first saw it.