-
Notifications
You must be signed in to change notification settings - Fork 10
Support for other browsers #9
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
Support for other browsers #9
Conversation
80212ec
to
11aedcf
Compare
This looks like great progress! On my phone now but I'll take a look at the diffs later. |
This is really good work, I'd like to support other browsers, especially Chrome. Opera and webkitgtk sound nice, but could be added later. I think I put a note in README.md or lib.rs about browser support, that will need updating when ChromeDriver goes in. A few suggestions for you here. Please feel free to give alternatives. |
bb64f9e
to
7b7e27e
Compare
Use stderrlog to log to stderr when the user increases verbosity with -v. With -vvvv TRACE messages from the webdriver_client are visible.
The required attribute is not necessary. The "capabilities" and "desiredCapabilities" attribute is mandatory by some servers, the spec describes this as > Let capabilities request be the result of getting the property "capabilities" from parameters. > 1. If capabilities request is not a JSON object, return error with error code invalid argument. but at least WebKitWebDriver refuses to proceed if the the attribute is not available. To be safe I just set it to an actual object instead of null.
By default chromedriver is NOT compliant with the w3c spec. But one can request w3c compliance with a capability extension included in the new session command payload.
This commit adds a driver launcher for the chromedrivr, the type is mostly the same as the GeckoDriver type minus the custom binary option that chromedriver does not have. Added a new option --driver/-D to the `www` cli to specify the desired driver (chromedriver or, the default geckodriver).
One of the pieces of the api that is very well documented is frame/element handling - this commit adds some basic docstrings to the frame methods, and makes the Element::new() method public. For examples I've addedd two more commands to the www binary - `frames` lists iframes in a page with their reference id - `switchframe ID` switches the current context to the selected frame - `switchframe` switches to the toplevel context This still falls short in two areas - there is no way to determine the current frame - AFAIK there is no command for this in the webdriver spec - we are missing a method to switch to the parent frame
I can't find a reference to this attribute in the spec. And I cant remember why I added it.
The switch frame command failed to execute in chrome, the error message is pretty explicit it requires the payload of the method to carry the `ELEMENT` attribute instead of the attribute from the w3c spec (element-6066-11e4-a52e-4f735466cecf). I think the upstream issue is https://bugs.chromium.org/p/chromedriver/issues/detail?id=1992 The proposed workaround for this is to also serialize the ElementReference with an ELEMENT attribute. There is the risk of clashing with other implementations but so far have I have encoutered no issues. Removed the serialization test from the messages module.
Included some tests for frame switching. Took the opportunity do add some docstrings and made the ref constructor public.
7b7e27e
to
7b330d4
Compare
This commit is just meant to verify that fluffysquirrels#9 works. Some tests fail due to diferences between the output of firefox and chrome.
7b330d4
to
752a6f2
Compare
Ok I've moved all of the travis bits to #14. I think i covered all you comments, except the one about avoiding the 'goog:chromeOptions' in the session cmd constructor. BTW github seems to hide away the comments made in a commit when I rebased, original links for the commits and comments |
This looks great, very happy for it to be merged. Wow, github hiding those previous comments when you rebase is incredibly annoying, I've not noticed how bad it was before. What I'd expect is a new entry to show up with the old commits greyed out or something. |
I created #16 "Consider refactoring browser-specific capabilities on creating a new session" to discuss the 'goog:chromeOptions' in the session cmd constructor. |
Hi, I've been looking into using this with other browsers
www
just because it makes debugging easierI also tried to test with other implementations, but failed for unrelated reasons
Other than that I've added tests using the chrome driver, but it took some fiddling with travis likely because of this issue in travis