getTagName

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

Usage

1
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"
})

Uses