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

World 'by' object incorrect #25

Open
edmulraney opened this issue Oct 23, 2015 · 5 comments
Open

World 'by' object incorrect #25

edmulraney opened this issue Oct 23, 2015 · 5 comments

Comments

@edmulraney
Copy link

Hi,

The World object's 'by' property won't work as it's currently set:
lib/index.js Line 29:
this.by = protractor.By;

It worked when we set it to:

this.by = webdriver.By;

@pellekrogholt
Copy link

Observation (using protractor 3.0.0 and cucumber.js 0.9.2 and node 4.2.3 or 5.0.0):

For by.css and by.xpath I suddenly got:

  TypeError: Invalid locator
      at Function.webdriver.Locator.checkLocator (<project>/node_modules/protractor-cucumber/node_modules/selenium-webdriver/lib/webdriver/locators.js:248:9)

but not for by.model, by.buttonText.

with the above adjustment it works but I dont understand the approach then the protractor selectors can be called that way. which might be ok they can just be called through this.protractor ...

pellekrogholt added a commit to pellekrogholt/protractor-cucumber that referenced this issue Jan 12, 2016
by uses `webdriver.By` to solve `TypeError: Invalid locator at Function.webdriver.Locator.checkLocator` AndrewKeig#25
@leegee
Copy link

leegee commented Feb 23, 2016

👍 Patch brought my code to life, too.

@gorghoa
Copy link

gorghoa commented Apr 13, 2016

Patch worked for me too.

protractor-cucumber: 0.1.8
cucumber.js : 0.10.2
protractor: 3.1.1 (same error with 3.2.2)

Got the error when using by.css (Invalid Locator) with chrome & firefox

TypeError: Invalid locator
         at Function.webdriver.Locator.checkLocator (node_modules/selenium-webdriver/lib/webdriver/locators.js:247:9)
         at webdriver.WebDriver.findElements (node_modules/selenium-webdriver/lib/webdriver/webdriver.js:995:31)
         at node_modules/protractor/built/element.js:137:30
         at promise.Promise.goog.defineClass.invokeCallback_ (node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:1337:14)
         at promise.ControlFlow.goog.defineClass.goog.defineClass.abort_.error.executeNext_.execute_ node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:2776:14)
         at promise.ControlFlow.goog.defineClass.goog.defineClass.abort_.error.executeNext_ (node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:2758:21)
         at goog.async.run.processWorkQueue (node_modules/selenium-webdriver/lib/goog/async/run.js:124:15)
         at process._tickCallback (internal/process/next_tick.js:103:7)

@leegee
Copy link

leegee commented Apr 13, 2016

I switched to protractor-cucumber-framework -- don't let the lack of docs fool you, it is well-maintained, and is only undocumented because it doesn't really need docs.

@gorghoa
Copy link

gorghoa commented Apr 19, 2016

Hi @leegee, switching to protractor-cucumber-framework is indeed a smart move 👍

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

4 participants