Element Inspection Commands

Microsoft Edge supports the following WebDriver commands for inspecting elements:

HTTP RequestCommands
/session/{sessionId}/elementFind Element, Find Elements
/session/{sessionId}/element/{id}/attribute/{name}Get Element Attribute
/session/{sessionId}/element/{id}/css/{propertyName}Get CSS Value
/session/{sessionId}/element/{id}/displayedIs Element Displayed
/session/{sessionId}/element/{id}/enabledIs Element Enabled
/session/{sessionId}/element/{id}/nameGet Element Tag Name
/session/{sessionId}/element/{id}/selectedIs Element Selected
/session/{sessionId}/element/{id}/textGet Element Text

Find Element

NameFind Element
DescriptionSearches for a given element on the page, starting from the document root.
SpecW3C WebDriver, JSON Wire Protocol
HTTP RequestPOST /session/{sessionId}/element

JSON Parameters

{
    "using": "id",
    "value": "clickAnchorElement"
}

JSON Response Value

{
    "sessionId": "{sessionId}",
    "status": 0,
    "value": {
        "ELEMENT": "{elementId}",
        "element-6066-11e4-a52e-4f735466cecf": "{elementId}"
    }
}

Find Elements

NameFind Elements
DescriptionSearches for all elements on the page with a given attribute value, starting from the document root.
SpecW3C WebDriver, JSON Wire Protocol
HTTP RequestPOST /session/{sessionId}/elements

JSON Parameters

{
    "using": "id",
    "value": "clickAnchorElement"
}

JSON Response Value

{
    "sessionId": "{sessionId}",
    "status": 0,
    "value": {
        "ELEMENT": "{elementId}",
        "element-6066-11e4-a52e-4f735466cecf": "{elementId}"
    }
}

Get Element Attribute

NameGet Element Attribute
DescriptionGets the value of the specified element’s specified attribute.
SpecW3C WebDriver, JSON Wire Protocol
HTTP RequestGET /session/{sessionId}/element/{elementId}/attribute/{name}

JSON Parameters
None.

JSON Response Value

{
    "sessionId": "{sessionId}",
    "status": 0,
    "value": "{value}"
}

Get CSS Value

NameGet CSS Value
DescriptionQueries the computed value of the specified element’s specified CSS property.
SpecW3C WebDriver, JSON Wire Protocol
HTTP RequestGET /session/{sessionId}/element/{elementId}/{propertyName}

JSON Parameters
None.

JSON Response Value

{
    "sessionId": "{sessionId}",
    "status": 0,
    "value": "{value}"
}

Is Element Displayed

NameIs Element Displayed
DescriptionDetermines if an element is currently displayed.
SpecW3C WebDriver, JSON Wire Protocol
HTTP RequestGET /session/{sessionId}/element/{elementId}/displayed

JSON Parameters
None.

JSON Response Value

{
    "sessionId": "{sessionId}",
    "status": 0,
    "value": {bool}

}

Is Element Enabled

NameIs Element Enabled
DescriptionDetermines if an element is currently enabled.
SpecW3C WebDriver, JSON Wire Protocol
HTTP RequestGET /session/{sessionId}/element/{elementId}/name

JSON Parameters
None.

JSON Response Value

{
    "sessionId": "{sessionId}",
    "status": 0,
    "value": {bool}
}

Get Element Tag Name

NameGet Element Text
DescriptionRetrieves the specified element’s tag name.
SpecW3C WebDriver, JSON Wire Protocol
HTTP RequestGET /session/{sessionId}/element/{elementId}/name

JSON Parameters
None.

JSON Response Value

{
    "sessionId": "{sessionId}",
    "status": 0,
    "value": "{tagName}"
}

Is Element Selected

NameIs Element Selected
DescriptionDetermines if an OPTION element, or an INPUT element of type checkbox or radiobutton is currently selected.
SpecW3C WebDriver, JSON Wire Protocol
HTTP RequestGET /session/{sessionId}/element/{elementId}/selected

JSON Parameters
None.

JSON Response Value

{
    "sessionId": "{sessionId}",
    "status": 0,
    "value": {bool}

}

Get Element Text

NameGet Element Text
DescriptionReturns the visible text for the element.
SpecW3C WebDriver, JSON Wire Protocol
HTTP RequestGET /session/{sessionId}/element/{elementId}/text

JSON Parameters
None.

JSON Response Value

{
    "sessionId": "{sessionId}",
    "status": 0,
    "value": "{value}"
}