View Source Improve this doc

getTagName

Get tag name of a DOM-element found by given selector.

Usage

1
2
browser.getTagName(selector);

Parameters

Param Type Details
selector String element with requested tag name

Example

index.html
1
<div id="elem">Lorem ipsum</div>
getTagName.js
1
2
3
4
5
6
it('should demonstrate the getTagName command', function () {
var elem = $('#elem');
var tagName = elem.getTagName();
console.log(tagName); // outputs: "div"
})

Returns

  • <String/String[]>: the element’s tag name, as a lowercase string

Uses