HTML vs. URL based scripting Load Runner

  • HTML based scripting
  • URL based scripting

HTML:

  • It records/captures a user scenario similar to how a user interacts with an application, it can be called as browser context recording.
  • It will not send any explicit requests to static resources (.css, .js, .png...etc) or dependent requests, but downloads them automatically along with main request, unlike the URL based scripting
Script Type 1: A script describing user actions (eg: web_link, web_submit_form)

  • web_link, web_submit_form..etc are context sensitive functions and they depend on previous operations.
  • It works at HTML level(i.e DOM elements level)
     Eg:





As shown above web_image function("Search Flight Button") works only when the DOM elements (i.e <IMG> and its attributes) are loaded upon successful completion of previous operations.

Script Type 2: A script containing explicit URLs  only (eg: web_url, web_submit_data)
  • web_url, web_submit_data..etc are context less functions and they are independent of previous operations.
  • It works at HTTP level (i.e Request - Response based) 
     Eg: 

Observe that "search flight button" is recorded as web_url function, it sends an explicit request(i.e using URL attribute) when user clicks 'Flight' button, so it is independent of previous operations.

URL:


  • It will send explicit requests to static resources (.css, .js, .png...etc) and dependent requests along with main request.(refer below screenshot)
  • Its a context-less recording unlike the HTML based scripting.
  • It works at HTTP level (i.e Request - Response based).
Script Type 1: Create concurrent groups for resources after their HTML page

  • Records URLs and their resources in concurrent groups, a concurrent group represents links and resources that are loaded on a page at the same time.
      Eg: 



Observe that for a 'Search Flight Button' action, it records dependent and static resources requests       explicitly(web_concurrent requests) along with main request. (i.e all the web_concurrent group requests above belongs to "Search Flight Button" action).

Script Type 2: Use Web Custom Requests only


  • It records all requests as web_custom requests
  • The web_custom_request function is an action function that allows you to create a custom HTTP request using any method or body.
     Eg: 





Note: What kind of recording options to be selected depends on kind of application and how you want to emulate the scenario, but generally "HTML" with "Script Type 2: A script containing explicit URLs  only (eg: web_url, web_submit_data)" is preferred. 

No comments:

Post a Comment