HTTP/HTML Protocol in LR

When you are starting to record web based application, you should be aware about some concepts and terms used in the Web based scripting, Knowing these terms will help in scripting and putting the logics.
I am going to describe most common terms and differences between them.

Difference between HTML-based script and URL-based script

HTML-mode
HTML-mode recording is the default and recommended recording mode. It records HTML action in the context of the current Web page (which means everything you see on the web page will be recorded in a single function). However, having mentioned the above, it can be configured to your needs on the level of resources you want to record (Refer to Vugen User Guide, “Setting Recording Options for Web Vusers” for more information).
The advantage of this mode is that it generates a script that is intuitive to the reader in terms of what is the form requesting (in a form of entire web page). Readers of the scripts will then be able to recognize each “logical” requests/call made to the server, making amendments to the script easily.
 
URL-mode
The URL-mode option instructs VuGen to record all requests and resources from the server. It automatically records every HTTP resource as URL steps. This recording mode captures even non-HTML applications such as applets and non-browser applications.
The advantage of this mode is that it generates a script that has all known resources downloaded for your viewing. This works good with non-HTML applications such as applets and non-browser applications (e.g. Win32 executables). But having everything together creates another problem of overwhelming low-level information and making the script unintuitive.


Difference between web_submit_data and web_submit_form

web_submit_data
The web_submit_data function is an action function that performs an "unconditional" or "contextless" form submission. It allows you to generate GET and POST requests as made by the HTML forms. You do not need to have a form context to execute this request.
web_submit_data is recorded only when VuGen is in either the URL–based recording mode, or in the HTML–based recording mode with the A script containing explicit URLs only option checked 
The method indicates how the data of the form is sent to the server, whether as a query within the URL (GET), or as a request body (POST).
This function is generated when VuGen is set to record a Web session in HTTP (all requests from the server) recording mode. VuGen also records a web_submit_data statement whenever a form is submitted and it is unable to generate a web_submit_form statement.
Examples of non–HTML–generated resources are .gif and .jpg images. The List of Resource Attributes is only inserted when the recording option for these resources is set at Record within the current script step. This is the default setting.
 
web_submit_form
The web_submit_form function is an action function that submits a form. The web_submit_form function may be executed only in the context of a previous operation.
web_submit_form is recorded only when VuGen is in HTML–based recording mode.
Examples of non–HTML–generated resources are .gif and .jpg images. The List of Resource Attributes is only inserted when the recording option for these resources is set at "Record within the current script step". This is the default setting.


Diffrerence between GET and POST method

GET Method
   1. All the name value pairs are submitted as a query string in URL.
   2. It's not secured as it is visible in plain text format in the Location bar of the web browser.
   3. As the data transfers through address bar (URL) there are some restrictions in using space, some characters like ampersand (&) etc in the GET method of posting data. We have to take special care for encoding data if such special characters are present.
   4. Length of the string is restricted.
   5. If method is not mentioned in the Form tag, this is the default method used.
   6. If get method is used and if the page is refreshed it would not prompt before the request is submitted again.
   7. One can store the name value pairs as bookmark and directly be used while sharing with others - example search results.
   8. Data is always submitted in the form of text
   9. If the response of the page is always same for the posted query then use GET example database searches

POST Method
1. All the name value pairs are submitted in the Message Body of the request.
2. Length of the string (amount of data submitted) is not restricted.
3. Post Method is secured because Name-Value pairs cannot be seen in location bar of the web browser.
4. If post method is used and if the page is refreshed it would prompt before the request is resubmitted.
5. If the service associated with the processing of a form has side effects (for example, modification of a database or subscription to a service), the method should be POST.
6. Data is submitted in the form as specified in enctype attribute of form tag and thus files can be used in FileUpload input box.

Source: http://wiki.answers.com/Q/What_is_the_difference_between_get_and_post_method_in_HTTP#ixzz1vrcbU4KW

3 comments: