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

sendKeys example uses webdriver.Key instead of protractor.Key #1567

Closed
plynchnlm opened this issue Nov 25, 2014 · 12 comments
Closed

sendKeys example uses webdriver.Key instead of protractor.Key #1567

plynchnlm opened this issue Nov 25, 2014 · 12 comments
Assignees

Comments

@plynchnlm
Copy link

On the sendKeys API page, the example reads " element.sendKeys("text was", webdriver.Key.CONTROL, ...." When I tried something like that, I got an error that webdriver was not defined. It took me a while before I found that I could use protractor.Key.CONTROL instead.

@juliemr
Copy link
Member

juliemr commented Nov 25, 2014

This is because we grab the documentation directly from webdriver - @sjelin if we could do something smarter here, that would be great.

Not sure we want to actually modify the webdriver documentation, but maybe have notes about it?

@plynchnlm
Copy link
Author

I don't actually see any changes on the page I mentioned, but maybe the update hasn't been made public yet (or maybe the change was made to some other page).

@sjelin
Copy link
Contributor

sjelin commented Dec 10, 2014

It was a little while before we pushed the fixed version, but it's up now

@plynchnlm
Copy link
Author

Are you sure? I don't actually see any changes to the page I mentioned in opening the issue, but maybe I am missing something.

@sjelin
Copy link
Contributor

sjelin commented Dec 12, 2014

I think you just need to reload the page

@plynchnlm
Copy link
Author

Actually, I did try reloading the page, trying a different browser, and (tonight) a different network to eliminate the possibility of some proxy caching the old version. I still don't see the change. If you decided not to change the page, that is fine -- and I don't mean to complain -- but you seem to think you have fixed the issue I mentioned. I am sure you fixed something, but not the instance I reported. To reiterate what I send in my initial report, on the page http://angular.github.io/protractor/#/api?view=webdriver.WebElement.prototype.sendKeys I am seeing the text webdriver.Key.CONTROL in the example, when protractor.Key.CONTROL is what is really available. I was looking to see either that change, or some explanation on the page that when we read "webdriver.Key" we should mentally subtitute "protractor.Key". But, if there is some other way in which you have addressed the issue on the page, let me know what I should be looking for.

@juliemr
Copy link
Member

juliemr commented Dec 18, 2014

I think Sammy was referring to a different issue - I don't think we actually modify the docs from webdriver now.

Maybe we should consider exporting the webdriver namespace as webdriver globally? It adds another global (breaking change), but it would make some stuff a bit clearer...

@sjelin
Copy link
Contributor

sjelin commented Dec 18, 2014

Sorry, yeah, I was confused. We could just run s/(\s|^)webdriver\./$1protractor./ over the relevant portions of the docs.

@sjelin sjelin reopened this Dec 18, 2014
@sjelin
Copy link
Contributor

sjelin commented Jan 13, 2015

@juliemr Which approach would you prefer? The (probably imperfect) regex or the (potentially breaking) webdriver?

@sjelin
Copy link
Contributor

sjelin commented Jan 30, 2015

@juliemr If you don't express a preference by EOD I'm just gonna go with the regex 😛

@sjelin
Copy link
Contributor

sjelin commented Jun 8, 2015

In the end I decided to just put a disclaimer at the top of each page which uses webdriver syntax. Automatically converting the syntax from webdriver to protractor wasn't going to work.

@andresdominguez
Copy link
Contributor

See #2169

@sjelin sjelin closed this as completed in 9747966 Jun 26, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants