Export (0) Print
Expand All

getText method

[Some information relates to pre-released product which may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.]

Gets the text in the modal prompt of the window.alert(), window.confirm(), or window.prompt() type.

  "name": "getText",
  "parameters": {},
  "sessionId": "[sessionId]"




This is the command you're passing in. In this case, get.


This is a wrapper object in which you'll embed other objects to be passed to WebDriver as parameters for the command.


The elementId as provided by the findElement or findElements commands.


The sessionId value of the session you are targeting.

Return value

A JSON response object containing:

  • sessionId
  • status
  • value - a string containing the modal window text


For users of Internet Explorer Developer Channel

The first release of Internet Explorer Developer Channel contained an early preview of our WebDriver functionality. For that release only, all commands had to be wrapped in a command object. In the example below the command object wrapper is in bold:


  "command": {

    "name": "[command]",

    "parameters": {},

    "sessionId": "[sessionId]"



The command object wrapper is not used in general release versions of Internet Explorer, only the first release of Internet Explorer Developer Channel.

See also

WebDriver in Internet Explorer Developer Channel
WebDriver in IE11



© 2015 Microsoft