Selenium Script – QUALYS WAS

Why Selenium Script in QUALYS Web Application Scan?

The selenium script is an alternative way to authenticate the desired web application URL. In a scenario where your typical web application fails authentication due to continuous bombardment of WAS then one can use Selenium script as it gives a provision to wait for the stipulated timeframe or until the previous authentication session has logged out. This in-turn saves the failure of WAS Scan due to the authentication issue.

Sample Selenium Script:

<?xml version=”1.0″ encoding=”UTF-8″?>

<html xmlns=”http://www.w3.org/1999/xhtml&#8221; xml:lang=”en” lang=”en”>

<head>

<meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8″ />

<link rel=”selenium.base” href=”http://testdemo15.com/&#8221; />

<title>Qualys Selenium_TestDemo15_Admin_v15</title>

</head>

<body>

<table cellpadding=”1″ cellspacing=”1″ border=”1″>

<thead>

<tr><td rowspan=”1″ colspan=”3″>Sample Test Case</td></tr>

</thead>

<tbody>

<tr><td>open</td><td>http://testdemo15.com/login/LoginForm.jsp</td><td></td&gt;

</tr>

<tr><td>click</td><td>id=j_username</td><td></td>

</tr>

<tr><td>type</td><td>id=j_username</td><td>TestDemo15Username</td>

</tr>

<tr><td>click</td><td>id=j_password</td><td></td>

</tr>

<tr><td>type</td><td>id=j_password</td><td>TestDemo15Password</td>

</tr>

<tr><td>click</td><td>css=input.formButton</td><td></td>

</tr>

<tr><td>pause</td><td>60000</td><td></td>

</tr>

<tr><td>waitForElementPresent</td><td>css=div:contains(“Log Out”)</td><td></td>

</tr>

</tbody></table>

</body>

</html>

Explanation of fields used in above Selenium Script:

  • URL under WAS is http://testdemo15.com/ – Enter in the field “selenium.base”
  • Login page for the URL under WAS is http://testdemo15.com/login/LoginForm.jsp – Enter in the field “open”
  • Username for the WAS URL is TestDemo15Username – Enter in the “type” with name “id=j_username”
  • Password for the WAS URL is TestDemo15Password – Enter in the “type” with name “id=j_password”
  • Wait period when authentication of the desired WAS URL is busy is 60000 (in milliseconds) – Enter in the field “pause”
  • An additional wait period until the previous authentication session has logged out can be used – css=div:contains(“Log Out”) – Enter in the field “waitForElementPresent”

Join the Conversation

  1. Unknown's avatar
  2. Unknown's avatar
  3. Harshita do cm Purswani Zn jk's avatar
  4. Unknown's avatar
  5. veenarohida1010gmailcom's avatar
  6. Tejashree Joshi's avatar

32 Comments

  1. Created Selenium script using this post. Thank you and keep posting such solutions.

    Like

Leave a comment

Design a site like this with WordPress.com
Get started