WebElmCount Description

download WebElmCount Description

of 1

description

test

Transcript of WebElmCount Description

WebElmCount Description

public static int WebElmCount(int intTestInstance,String objectType,String xpathIdentifier,String strXpathKey,String strValue)

objectType This is the type of the object, either input, span, a , td , tr etcxpathIdentifier This describes the key contains or starts-with etcstrXpathKey Either id, class, name etcstrValue Object value

The main thing is that the parameters that are passed will form an xpath within the function. The xpath must be such a way that all objects must have a common object value i.e strValue.

e.gWebElmCount (int intTestInstance,"input","contains","id","firstname")

This will first form the xpathXpath=//input[contains(@id,firstname)]

After this xpath is formed, well check for similar objects in that page.

List row=wlmElement.findElements(By.xpath(xpath));Return row.size();

Note: firstname should be common for all the drivers, then we ll be able to get the total number of objects in a page