GetAttributeFromElementsAsync

Parent Previous Next

GetAttributeFromElementsAsync

Description: the method returns a list of values of the specified attribute from a set of elements

Syntax: GetAttributeFromElementsAsync(string by, string locator, string attribute)

Return value: List


Example:

List<string> values = await tester.GetAttributeFromElementsAsync(Tester.BY_CSS, "input", "name");

if(values != null) 

{

       foreach (string attr in values)

               tester.ConsoleMsg(attr);

}



List<string> values = await tester.GetAttributeFromElementsAsync(Tester.BY_XPATH, "//input", "name");

if(values != null)

{

       foreach (string attr in values)

               tester.ConsoleMsg(attr);

}

Created with the Personal Edition of HelpNDoc: Easily create Web Help sites