Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not being to see locators in development tool or use pop up #7

Closed
sudha88 opened this issue Mar 6, 2015 · 25 comments
Closed

Not being to see locators in development tool or use pop up #7

sudha88 opened this issue Mar 6, 2015 · 25 comments

Comments

@sudha88
Copy link

sudha88 commented Mar 6, 2015

Hi Andres-
I installed elementor following instructions but I am not able to see any suggestions for locator or use pop up box.Please see screenshot
screen shot 2015-03-05 at 10 14 23 pm

@andresdominguez
Copy link
Owner

Hello @sudha88

Protractor uses the developer tools to connect with chrome. When the devtools window is open protractor cannot issue commands.

If you want to use the developer tools you need to open a second tab pointing to the same URL as the first tab. Then open the devtools in the second tab.

@sudha88
Copy link
Author

sudha88 commented Mar 7, 2015

Yes. I did that as you mentioned in your instructions but I was not able to see any locators. Can you think of any other reason?

Sent from my iPhone

On Mar 7, 2015, at 2:25 PM, Andres Dominguez notifications@github.com wrote:

Hello @sudha88

Protractor uses the developer tools to connect with chrome. When the devtools window is open protractor cannot issue commands.

If you want to use the developer tools you need to open a second tab pointing to the same URL as the first tab. Then open the devtools in the second tab.


Reply to this email directly or view it on GitHub.

@andresdominguez
Copy link
Owner

Try to select a couple of nodes in the developer tools. The extension fires when you change the currently selected item. Do you see the log in the terminal moving?

Let me know if it works.

@andresdominguez
Copy link
Owner

I have to board a plane. I will take a look at it tomorrow.

Can you tell me your node version?

@sudha88
Copy link
Author

sudha88 commented Mar 8, 2015

node version v0.10.36

On Sat, Mar 7, 2015 at 3:13 PM, Andres Dominguez notifications@github.com
wrote:

I have to board a plane. I will take a look at it tomorrow.

Can you tell me your node version?


Reply to this email directly or view it on GitHub
#7 (comment)
.

Thanks,
Sudha

@sudha88
Copy link
Author

sudha88 commented Mar 8, 2015

Hi Andres
I updated to protractor 1.8 and after that see some changes in protractor
logs in developer tools..I now see locators they are accompanied with
errors.Please see examples below.

  1. by.css('.action.clickable'): "There was a webdriver error: TypeError
    Invalid locator"
  2. by.css('div.action.clickable'): "There was a webdriver error:
    TypeError Invalid locator"
  3. by.css('div[ng-click="openGiftDialog()"]'): "There was a webdriver
    error: TypeError Invalid locator"
  4. by.css('div[ng-if="!giftSelected"]'): "There was a webdriver error:
    TypeError Invalid locator"

On Sat, Mar 7, 2015 at 10:30 PM, Sudha Menon sudha@highground.com wrote:

node version v0.10.36

On Sat, Mar 7, 2015 at 3:13 PM, Andres Dominguez <notifications@github.com

wrote:

I have to board a plane. I will take a look at it tomorrow.

Can you tell me your node version?


Reply to this email directly or view it on GitHub
#7 (comment)
.

Thanks,
Sudha

Thanks,
Sudha

@mick26
Copy link

mick26 commented Mar 11, 2015

I am getting the exact same errors. Windows 7 32bit, Node v0.12.0,npm v2.51
Protractor v1.8.0 (installed globally only), Elementor v0.1.2

C:>elementor http://www.angularjs.org
Getting page at: http://www.angularjs.org
Listening on port 13000

Testing locators { byCss:
{ nodeName: 'div',
'app-run': 'hello.html',
class: 'well ng-scope' } }
Testing locator list [ { name: 'byCss',
locator: 'by.css('div[app-run="hello.html"]')',
countExpression: 'element.all(by.css('div[app-run="hello.html"]')).count()
' },
{ name: 'byCss',
locator: 'by.css('div.well')',
countExpression: 'element.all(by.css('div.well')).count()' },
{ name: 'byCss',
locator: 'by.css('.well')',
countExpression: 'element.all(by.css('.well')).count()' } ]
Sending locator results { 'by.css('div[app-run="hello.html"]')': 'There was a
webdriver error: TypeError Invalid locator',
'by.css('div.well')': 'There was a webdriver error: TypeError Invalid locato
r',
'by.css('.well')': 'There was a webdriver error: TypeError Invalid locator'
}
//========================================================
C:\Users\Mick>webdriver-manager start
seleniumProcess.pid: 3188
11:17:23.556 INFO - Launching a standalone server
Setting system property webdriver.chrome.driver to C:\Users\Mick\AppData\Roaming
\npm\node_modules\protractor\selenium\chromedriver.exe
11:17:23.796 INFO - Java: Oracle Corporation 25.20-b23
11:17:23.797 INFO - OS: Windows 7 6.1 x86
11:17:23.813 INFO - v2.45.0, with Core v2.45.0. Built from revision 5017cb8
11:17:24.009 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
11:17:24.011 INFO - Version Jetty/5.1.x
11:17:24.013 INFO - Started HttpContext[/selenium-server,/selenium-server]
11:17:24.201 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler@c6a292
11:17:24.201 INFO - Started HttpContext[/wd,/wd]
11:17:24.201 INFO - Started HttpContext[/selenium-server/driver,/selenium-server
/driver]
11:17:24.202 INFO - Started HttpContext[/,/]
11:17:24.208 INFO - Started SocketListener on 0.0.0.0:4444
11:17:24.209 INFO - Started org.openqa.jetty.jetty.Server@11bc7ed
11:19:45.139 INFO - Executing: [new session: Capabilities [{browserName=chrome,
chromeOptions={args=[--load-extension=C:\Users\Mick\AppData\Roaming\npm\node_mod
ules\elementor\extension]}}]])
11:19:45.175 INFO - Creating a new session for Capabilities [{browserName=chrome
, chromeOptions={args=[--load-extension=C:\Users\Mick\AppData\Roaming\npm\node_m
odules\elementor\extension]}}]
Starting ChromeDriver 2.14.313457 (3d645c400edf2e2c500566c9aa096063e707c9cf) on
port 44940
Only local connections are allowed.
11:19:48.222 INFO - Done: [new session: Capabilities [{browserName=chrome, chrom
eOptions={args=[--load-extension=C:\Users\Mick\AppData\Roaming\npm\node_modules
elementor\extension]}}]]
11:19:48.426 INFO - Executing: [set script timeoutt: 11000])
11:19:48.597 INFO - Done: [set script timeoutt: 11000]
11:19:48.701 INFO - Executing: [get: http://www.angularjs.org])
11:19:57.441 INFO - Done: [get: http://www.angularjs.org]
11:20:36.950 INFO - Executing: [execute async script: try {

@zivSher
Copy link

zivSher commented Mar 11, 2015

Hey,
just started using it.
great idea but I also get those:

'by.css('#searchInput')': 'There was a webdriver error: TypeError Invalid locator',
'by.css('input[autofocus=""]')': 'There was a webdriver error: TypeError Invalid locator',
'by.css('input.form-control')': 'There was a webdriver error: TypeError Invalid locator',
'by.css('.form-control')': 'There was a webdriver error: TypeError Invalid locator',
'by.css('input[type="search"]')': 'There was a webdriver error: TypeError Invalid locator',
'by.css('input[placeholder="Enter name"]')': 'There was a webdriver error: TypeError Invalid locator',
'by.css('input[ng-model="searchTerm"]')': 'There was a webdriver error: TypeError Invalid locator',
'by.id('searchInput')': 'There was a webdriver error: TypeError Invalid locator',
'by.model('searchTerm')': 1 }

@andresdominguez
Copy link
Owner

I was finally able to reproduce the error. I haven't been able to find the cause, but I promise I will.

In the meantime, please use the github version:

$ git clone https://github.com/andresdominguez/elementor.git
$ ./elementor/bin/elementexplorer.js [url]

@jusefb
Copy link

jusefb commented Mar 15, 2015

Hi,

I am still getting the error "There was a webdriver error: TypeError Invalid locator" even with the github version of elementor.

@ch0wdan
Copy link

ch0wdan commented Mar 16, 2015

I also am seeing this issue on Mac - Node 0.10.32

Heres my console logs after trying to get element for both Elementor and webdriver manager.

Elementor Term:
Getting page at: https://angularjs.org
Listening on port 13000

Testing locators { byCss:
{ nodeName: 'a',
class: 'learn-link',
href: 'http://angular.codeschool.com' },
byLinkText: '\n \n Learn Angular in your browser for free!\n ' }
Testing locator list [ { name: 'byCss',
locator: 'by.css('a.learn-link')',
countExpression: 'element.all(by.css('a.learn-link')).count()' },
{ name: 'byCss',
locator: 'by.css('.learn-link')',
countExpression: 'element.all(by.css('.learn-link')).count()' },
{ name: 'byCss',
locator: 'by.css('a[href="http://angular.codeschool.com"]')',
countExpression: 'element.all(by.css('a[href="http://angular.codeschool.com"]')).count()' },
{ name: 'byLinkText',
locator: 'by.linkText('Learn Angular in your browser for free!')',
countExpression: 'element.all(by.linkText('Learn Angular in your browser for free!')).count()' } ]
Sending locator results { 'by.css('a.learn-link')': 'There was a webdriver error: TypeError Invalid locator',
'by.css('.learn-link')': 'There was a webdriver error: TypeError Invalid locator',
'by.css('a[href="http://angular.codeschool.com"]')': 'There was a webdriver error: TypeError Invalid locator',
'by.linkText('Learn Angular in your browser for free!')': 'There was a webdriver error: TypeError Invalid locator' }

WebDriver Term:
9:39:34.988 INFO - Done: [get: https://angularjs.org]
09:40:14.609 INFO - Executing: [execute async script: try { return (function (rootSelector, callback) {
var el = document.querySelector(rootSelector);

try {
if (!window.angular) {
throw new Error('angular could not be found on the window');
}
if (angular.getTestability) {
angular.getTestability(el).whenStable(callback);
} else {
if (!angular.element(el).injector()) {
throw new Error('root element (' + rootSelector + ') has no injector.' +
' this may mean it is not inside ng-app.');
}
angular.element(el).injector().get('$browser').
notifyWhenNoOutstandingRequests(callback);
}
} catch (err) {
callback(err.message);
}
}).apply(this, arguments); }
catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [body]])
09:40:14.621 INFO - Done: [execute async script: try { return (function (rootSelector, callback) {
var el = document.querySelector(rootSelector);

try {
if (!window.angular) {
throw new Error('angular could not be found on the window');
}
if (angular.getTestability) {
angular.getTestability(el).whenStable(callback);
} else {
if (!angular.element(el).injector()) {
throw new Error('root element (' + rootSelector + ') has no injector.' +
' this may mean it is not inside ng-app.');
}
angular.element(el).injector().get('$browser').
notifyWhenNoOutstandingRequests(callback);
}
} catch (err) {
callback(err.message);
}
}).apply(this, arguments); }
catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [body]]
09:40:14.631 INFO - Executing: [execute async script: try { return (function (rootSelector, callback) {
var el = document.querySelector(rootSelector);

try {
if (!window.angular) {
throw new Error('angular could not be found on the window');
}
if (angular.getTestability) {
angular.getTestability(el).whenStable(callback);
} else {
if (!angular.element(el).injector()) {
throw new Error('root element (' + rootSelector + ') has no injector.' +
' this may mean it is not inside ng-app.');
}
angular.element(el).injector().get('$browser').
notifyWhenNoOutstandingRequests(callback);
}
} catch (err) {
callback(err.message);
}
}).apply(this, arguments); }
catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [body]])
09:40:14.639 INFO - Done: [execute async script: try { return (function (rootSelector, callback) {
var el = document.querySelector(rootSelector);

try {
if (!window.angular) {
throw new Error('angular could not be found on the window');
}
if (angular.getTestability) {
angular.getTestability(el).whenStable(callback);
} else {
if (!angular.element(el).injector()) {
throw new Error('root element (' + rootSelector + ') has no injector.' +
' this may mean it is not inside ng-app.');
}
angular.element(el).injector().get('$browser').
notifyWhenNoOutstandingRequests(callback);
}
} catch (err) {
callback(err.message);
}
}).apply(this, arguments); }
catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [body]]
09:40:14.649 INFO - Executing: [execute async script: try { return (function (rootSelector, callback) {
var el = document.querySelector(rootSelector);

try {
if (!window.angular) {
throw new Error('angular could not be found on the window');
}
if (angular.getTestability) {
angular.getTestability(el).whenStable(callback);
} else {
if (!angular.element(el).injector()) {
throw new Error('root element (' + rootSelector + ') has no injector.' +
' this may mean it is not inside ng-app.');
}
angular.element(el).injector().get('$browser').
notifyWhenNoOutstandingRequests(callback);
}
} catch (err) {
callback(err.message);
}
}).apply(this, arguments); }
catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [body]])
09:40:14.656 INFO - Done: [execute async script: try { return (function (rootSelector, callback) {
var el = document.querySelector(rootSelector);

try {
if (!window.angular) {
throw new Error('angular could not be found on the window');
}
if (angular.getTestability) {
angular.getTestability(el).whenStable(callback);
} else {
if (!angular.element(el).injector()) {
throw new Error('root element (' + rootSelector + ') has no injector.' +
' this may mean it is not inside ng-app.');
}
angular.element(el).injector().get('$browser').
notifyWhenNoOutstandingRequests(callback);
}
} catch (err) {
callback(err.message);
}
}).apply(this, arguments); }
catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [body]]
09:40:14.667 INFO - Executing: [execute async script: try { return (function (rootSelector, callback) {
var el = document.querySelector(rootSelector);

try {
if (!window.angular) {
throw new Error('angular could not be found on the window');
}
if (angular.getTestability) {
angular.getTestability(el).whenStable(callback);
} else {
if (!angular.element(el).injector()) {
throw new Error('root element (' + rootSelector + ') has no injector.' +
' this may mean it is not inside ng-app.');
}
angular.element(el).injector().get('$browser').
notifyWhenNoOutstandingRequests(callback);
}
} catch (err) {
callback(err.message);
}
}).apply(this, arguments); }
catch(e) { throw (e instanceof Error) ? e : new Error(e); }, [body]])
09:40:14.675 INFO - Done: [execute async script: try { return (function (rootSelector, callback) {
var el = document.querySelector(rootSelector);

try {
if (!window.angular) {

@codef0rmer
Copy link

Me too getting the same error.

@ch0wdan
Copy link

ch0wdan commented Mar 17, 2015

On another note, this occurs also within the Webstorm Plugin. Users are not able to test directly inside webstorm

image

@deonclem
Copy link

Same here, no matter what I try, I get the same result :
{ 'element.all(by.css('div')).count()': 'There was a webdriver error: TypeError Invalid locator' }

Mac - Node 0.10.31 - Protractor 1.6.1 - npm 1.4.23 - Elementor 0.1.8

@andresdominguez
Copy link
Owner

Quick update:

I am working with the protractor team to fix this bug for good. The element explorer implementation changed after protractor 1.6.

Wait a few more days and I promise it will get fixed. I haven't forgotten.

Andres

@deonclem
Copy link

Great !

@ch0wdan
Copy link

ch0wdan commented Mar 20, 2015

Thanks! Looking forward to the update:)

Edit:

Any updates on this update??

@Rleahy22
Copy link

+1

@ch0wdan
Copy link

ch0wdan commented Mar 30, 2015

Any updates on this fix?

@andresdominguez
Copy link
Owner

The protractor team already made the change I requested. I have it running on my machine.

I already migrated to the head version of protractor. The change didn't make it to protractor 2.0.0.

I have to figure out a way to ship a local protractor version with elementor until they release the next protractor version. It should be done this week.

@andresdominguez
Copy link
Owner

I just pushed a new version to npm (1.0.4). It seems to be working. I will try to stress test it today to find bugs. The implementation is very different from the previous version, it may contain some bugs.

@sudha88
Copy link
Author

sudha88 commented Mar 31, 2015

Thank you Andres .I will help test too.

On Tue, Mar 31, 2015 at 9:01 AM, Andres Dominguez notifications@github.com
wrote:

I just pushed a new version to npm (1.0.4). It seems to be working. I will
try to stress test it today to find bugs. The implementation is very
different from the previous version, it may contain some bugs.


Reply to this email directly or view it on GitHub
#7 (comment)
.

Thanks,
Sudha

@ch0wdan
Copy link

ch0wdan commented Mar 31, 2015

Logging another issue that I'm seeing. Do we need to do anything besides update elementor (through npm) to get this to work?

@bvasilchik
Copy link

I"m still on protractor 1.8 but I'm assuming since (1.0.4) you packaged it with it's own version of protractor that doesn't matter? I still get 'There was a webdriver error: TypeError Invalid locator' }

also I'm using the --nonAngular flag

@andresdominguez
Copy link
Owner

This issue was fixed on version 1.0.7. Let me know if the problem persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants