WebApplication Qualys Security Scanning: How to Find XPath query in HTML DOM?

When you do web application security scan, we need to do authentication of application to extend the coverage. In most of the scanning tools (i.e qualys) has chrome extension to write selenium script which could do authentication in the application.

Any login selenium script finds appropriate HTML DOM elements (login or password) and do as per script commands. In authentication security scan, One has to know how to find login form DOM fields via Selenium XPATH Query. Let’s understand basic of XPATH in selenium script.

The basic format of XPath in selenium is explained below with screen shot.

Basic Format of XPath

Syntax for XPath selenium:

XPath contains the path of the element situated at the web page. Standard XPath syntax for creating XPath is.

Xpath=//tagname[@attribute='value']

Some more basic xpath expressions:

Xpath=//input[@type='text']				
Xpath=	//label[@id='message23']
Xpath=	//input[@value='RESET']
Xpath=//*[@class='barone']
Xpath=//a[@href='http://demo.guru99.com/']
Xpath= //img[@src='//cdn.guru99.com/images/home/java.png']

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.