Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

docs(debugging): change debugging info for element explorer #1717

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 18 additions & 11 deletions docs/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,29 +170,36 @@ When debugging or first writing test suites, you may find it helpful to
try out Protractor commands without starting up the entire test suite. You can
do this with the element explorer.

Currently, the explorer runs only with chrome and expects a standalone Selenium
Server to be running at http://localhost:4444 (see [Setting Up the Selenium Server](/docs/server-setup.md)).
To run element explorer, simply run protractor as you normally would, but pass in
the flag --elementExplorer:

From the Protractor directory, run with:

node ./bin/elementexplorer.js <urL>
protractor --elementExplorer

This will load up the URL on WebDriver and put the terminal into a REPL loop.
You will see a > prompt. The `browser`, `element` and `protractor` variables will
be available. Enter a command such as:

> element(by.id('foobar')).getText()
> browser.get('http://www.angularjs.org')

or

> browser.get('http://www.angularjs.org')
> element(by.id('foobar')).getText()

Typing tab at a blank prompt will fill in a suggestion for finding
elements. You can also use the `list(locator)` command to list all elements
matching a locator.

To get a list of functions you can call, try:
Element explorer will start chrome by default. However, you can specify
another browser, change browser settings, or specify any other config that you
normally would with your protractor test. To do this, pass configs to
protractor like you normally would,
but with the `--elementExplorer` flag set:

> browser
protractor [configFile] [options] --elementExplorer

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add an example like:

For example, to connect to ChromeDriver directly, use

protractor --directConnect --elementExplorer

Typing tab at a blank prompt will fill in a suggestion for finding
elements.
Element explore will ignore your specs, not set up your framework (e.g. jasmine,
mocha, cucumber), and only allow you to pass in 1 capability, but will honor
every other parameter in your config.


Taking Screenshots
Expand Down