Image check in LoadRunner
The image check is used to check if an image is present in the server response for a specific page, as the name implies. While image verification only confirms the content of images, text verification is often used to examine the existence of a specific word or phrase on a web page. Either a text check or an image check must be performed for each web page in the script. You read in the previous post how to add a text control. This article covers how to insert Image Check into the LoadRunner script.
Note: while text checks can be performed both during and after recording, image checks can only be added after recording. The option to add a video verification while the script is being recorded is not available. |
How can I add an image check to the LoadRunner script after burning?
- You must know the alt or src attributes of the image on the web page to add an image check in the script. Follow the steps below to get the alt or src attributes of the image:
- A. Launch the online browser;
- B. Right-click on the image;
- C. Click “Inspect” (in Chrome); “Inspect Element” (in Internet Explorer and Firefox);
Figure 01 – ‘Inspect’ option in Chrome
Figure 02
- Copy the alt or src value, if applicable. Note that the alt value in the snapshot below is empty, which requires copying the src value “image/webtours.png”. Anyone who can help you.
Image: 03
2. Visit the script for the Vuser.
3. In the Editor, find the place where the image control should be inserted.
4. To open the Steps Toolbox, select View from the menu, then choose Steps Toolbox (or press Ctrl+Alt+B).
5. Type ‘web_image_check’ in the steps toolbox.
6. The ‘web_image_check’ function will be displayed in the search results. Click on it twice.
7. In the “Image Control Properties” dialog box, enter the alt or src value.
Image: 04
8. Click ‘OK’ to add the function to the Vuser script.
Image: 05
Before running the script again, make sure the ‘Enable image and text verification’ box is checked.
Internet Protocol -> Preferences -> Audits -> Runtime Settings Enables text and image inspections.
Image: 06