From 99f465f3d2631e82094cc7c61a8f144aba8022e3 Mon Sep 17 00:00:00 2001 From: Hank Duan Date: Mon, 12 Jan 2015 18:18:02 -0800 Subject: [PATCH] docs(debugging): change debugging info for element explorer --- docs/debugging.md | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/docs/debugging.md b/docs/debugging.md index b6ec782a9..ed2880768 100644 --- a/docs/debugging.md +++ b/docs/debugging.md @@ -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 + 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 -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