You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Driver for Safari does not support find as does Chrome #764
Likely there is a problem in Safari driver (binary file, that connects to Web Browser), because some time ago Mink Driver tests mostly worked on Safari.
I don't see anything from that page that I haven't already done. The Safari browser does come up but it doesn't seem to work with equivalence to Chrome. All my tests pass w/o issue w/ Chrome.
Maybe you can record output from Selenium Server for Google Chrome and for Safari. This way we can clearly see all executed commands and which of them fails.
If for Safari same commands are executed and no error happens (just find call doesn't find anything), then maybe something different happens on a page in Safari (e.g. content, that is searched for is loaded later or via AJAX) and tests doesn't account for that.
Try the find operation on very basic page: empty page and element is right there immediately. If that works, then theory I've explained above might be causing this.
On Thu, Sep 20, 2018 at 10:19 AM, Alexander Obuhovich < ***@***.***> wrote:
Maybe you can record output from Selenium Server for Google Chrome and for
Safari. This way we can clearly see all executed commands and which of them
fails.
If for Safari same commands are executed and no error happens (just find
call doesn't find anything), then maybe something different happens on a
page in Safari (e.g. content, that is searched for is loaded later or via
AJAX) and tests doesn't account for that.
Try the find operation on very basic page: empty page and element is
right there immediately. If that works, then theory I've explained above
might be causing this.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#764 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABORPAGbebd48SQ3C3wZ2b1gwqGrmo-Yks5uc7IUgaJpZM4WyN3W>
.
Here is the safari - it fails with "username" element is not present on the page (SensioLabs\Behat\PageObjectExtension\PageObject\Exception\ElementNotFoundException)
11:22:20.696 INFO [GridLauncherV3.launch] - Selenium build info: version: '3.12.0', revision: '7c6e0b3'
11:22:20.697 INFO [GridLauncherV3$1.launch] - Launching a standalone Selenium Server on port 4444
2018-09-20 11:22:20.779:INFO::main: Logging initialized @306ms to org.seleniumhq.jetty9.util.log.StdErrLog
11:22:20.938 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 4444
11:22:25.264 DEBUG [WebDriverServlet.handle] - Found handler: org.openqa.selenium.remote.server.commandhandler.BeginSession@3bf9c16d
11:22:25.268 DEBUG [WebDriverServlet.lambda$handle$1] - /session: Executing POST on /session (handler: BeginSession)
11:22:25.345 INFO [ActiveSessionFactory.apply] - Capabilities are: Capabilities {browser: firefox, browserName: safari, ignoreZoomSetting: false, name: Behat feature suite, tags: [Wisnet-MacBook-Pro-2.local, PHP 7.1.16]}
11:22:25.347 INFO [ActiveSessionFactory.lambda$apply$11] - Matched factory org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.safari.SafariDriverService)
11:22:26.381 INFO [ProtocolHandshake.createSession] - Detected dialect: W3C
11:22:26.410 DEBUG [RemoteWebDriver.log] - Executing: newSession [null, newSession {desiredCapabilities=Capabilities {acceptInsecureCerts: false, browserName: Safari, browserVersion: 12.0, platformName: macOS, setWindowRect: true}}]
11:22:26.411 DEBUG [RemoteWebDriver.log] - Executed: [null, newSession {desiredCapabilities=Capabilities {acceptInsecureCerts: false, browserName: Safari, browserVersion: 12.0, platformName: macOS, setWindowRect: true}}]
11:22:26.415 INFO [RemoteSession$Factory.lambda$performHandshake$0] - Started new session C78BE052-CD73-4667-A97A-B159A35C92E4 (org.openqa.selenium.safari.SafariDriverService)
11:22:27.430 DEBUG [WebDriverServlet.handle] - Found handler: C78BE052-CD73-4667-A97A-B159A35C92E4 (org.openqa.selenium.safari.SafariDriverService)
11:22:27.431 DEBUG [WebDriverServlet.lambda$handle$1] - Handler thread for session C78BE052-CD73-4667-A97A-B159A35C92E4 (Safari): Executing POST on /session/C78BE052-CD73-4667-A97A-B159A35C92E4/url (handler: ServicedSession)
11:22:27.863 DEBUG [W3CHttpResponseCodec.decode] - Decoding response. Response code was: 200 and content: {"value":null}
11:22:27.867 DEBUG [WebDriverServlet.handle] - Found handler: C78BE052-CD73-4667-A97A-B159A35C92E4 (org.openqa.selenium.safari.SafariDriverService)
11:22:27.867 DEBUG [WebDriverServlet.lambda$handle$1] - Handler thread for session C78BE052-CD73-4667-A97A-B159A35C92E4 (Safari): Executing GET on /session/C78BE052-CD73-4667-A97A-B159A35C92E4/url (handler: ServicedSession)
11:22:27.871 DEBUG [W3CHttpResponseCodec.decode] - Decoding response. Response code was: 200 and content: {"value":"http:\/\/crossbrowsertesting.github.io\/login-form.html"}
11:22:27.873 DEBUG [WebDriverServlet.handle] - Found handler: C78BE052-CD73-4667-A97A-B159A35C92E4 (org.openqa.selenium.safari.SafariDriverService)
11:22:27.874 DEBUG [WebDriverServlet.lambda$handle$1] - Handler thread for session C78BE052-CD73-4667-A97A-B159A35C92E4 (Safari): Executing GET on /session/C78BE052-CD73-4667-A97A-B159A35C92E4/url (handler: ServicedSession)
11:22:27.877 DEBUG [W3CHttpResponseCodec.decode] - Decoding response. Response code was: 200 and content: {"value":"http:\/\/crossbrowsertesting.github.io\/login-form.html"}
11:22:28.886 DEBUG [WebDriverServlet.handle] - Found handler: C78BE052-CD73-4667-A97A-B159A35C92E4 (org.openqa.selenium.safari.SafariDriverService)
11:22:28.886 DEBUG [WebDriverServlet.lambda$handle$1] - Handler thread for session C78BE052-CD73-4667-A97A-B159A35C92E4 (Safari): Executing POST on /session/C78BE052-CD73-4667-A97A-B159A35C92E4/window/current/maximize (handler: ServicedSession)
11:22:28.918 DEBUG [W3CHttpResponseCodec.decode] - Decoding response. Response code was: 200 and content: {"value":{"y":23,"x":1680,"width":1920,"height":1057}}
11:22:28.925 DEBUG [WebDriverServlet.handle] - Found handler: C78BE052-CD73-4667-A97A-B159A35C92E4 (org.openqa.selenium.safari.SafariDriverService)
11:22:28.925 DEBUG [WebDriverServlet.lambda$handle$1] - Handler thread for session C78BE052-CD73-4667-A97A-B159A35C92E4 (Safari): Executing POST on /session/C78BE052-CD73-4667-A97A-B159A35C92E4/elements (handler: ServicedSession)
11:22:28.936 DEBUG [W3CHttpResponseCodec.decode] - Decoding response. Response code was: 200 and content: {"value":[{"element-6066-11e4-a52e-4f735466cecf":"node-EBAA65C8-40BC-41B9-954F-A7C421E7FD1C"}]}
11:22:28.971 DEBUG [WebDriverServlet.handle] - Found handler: C78BE052-CD73-4667-A97A-B159A35C92E4 (org.openqa.selenium.safari.SafariDriverService)
11:22:28.972 DEBUG [WebDriverServlet.lambda$handle$1] - Handler thread for session C78BE052-CD73-4667-A97A-B159A35C92E4 (Safari): Executing DELETE on /session/C78BE052-CD73-4667-A97A-B159A35C92E4 (handler: ServicedSession)
11:22:28.976 DEBUG [W3CHttpResponseCodec.decode] - Decoding response. Response code was: 200 and content: {"value":null}
11:22:28.980 INFO [ActiveSessions$1.onStop] - Removing session C78BE052-CD73-4667-A97A-B159A35C92E4 (org.openqa.selenium.safari.SafariDriverService)
11:22:28.986 DEBUG [W3CHttpResponseCodec.decode] - Decoding response. Response code was: 404 and content: {"value":{"error":"invalid session id","message":"","stacktrace":""}}
11:22:28.986 DEBUG [W3CHttpResponseCodec.decode] - Processing an error
11:22:29.007 DEBUG [UrlChecker.waitUntilUnavailable] - Waiting for http://localhost:22902/shutdown
11:22:29.008 DEBUG [UrlChecker.lambda$waitUntilUnavailable$2] - Polling http://localhost:22902/shutdown
11:22:29.014 DEBUG [HttpURLConnection.writeRequests] - sun.net.www.MessageHeader@495632415 pairs: {GET /shutdown HTTP/1.1: null}{User-Agent: Java/1.8.0_161}{Host: localhost:22902}{Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2}{Connection: keep-alive}
11:22:29.017 DEBUG [HttpURLConnection.getInputStream0] - sun.net.www.MessageHeader@c54b50f8 pairs: {null: HTTP/1.1 404 Not Found}{Server: SafariDriver/1.0}{Content-Type: application/json; charset=utf-8}{Date: Thu, 20 Sep 2018 16:22:29 GMT}{Accept-Ranges: bytes}{Content-Length: 109}{Cache-Control: no-cache}{Connection: keep-alive}
qanoerr-example (master) $ safaridriver --help
Usage: safaridriver [options]
-h, --help Prints out this usage information.
-p, --port Port number the driver should use. If the server
is already running, the port cannot be changed.
If port 0 is specified, a default port will be used.
--enable Applies configuration changes so that subsequent WebDriver
sessions will run without further authentication.
--w3c Use the standards-compliant W3C WebDriver protocol (default).
--legacy Use the legacy Selenium WebDriver protocol.
qanoerr-example (master) $
I see there is the --legacy - is there a way to force safaridriver to use legacy as a workaround?
Well, you could run safaridriver directly instead of using the selenium-server hub (as you probably don't need the hub). this is probably the easiest way to control this setting. I don't know whether the Selenium grid server allows to configure CLI flags used when launching browser drivers.
To run the browser driver directly as the selenium server, things are as easy as running it (safaridriver --legacy --port 4444) and changing your Mink config to connect to http://127.0.0.1:4444 instead of http://127.0.0.1:4444/wd/hub (the grid server exposes the Webdriver protocol on /wd/hub due to support for the older Selenium API, but browser drivers are exposing it at the root of their server)
Activity
aik099 commentedon Sep 20, 2018
What Mink Driver are you using?
bartonhammond commentedon Sep 20, 2018
"behat/mink-selenium2-driver": "^1.3",aik099 commentedon Sep 20, 2018
Likely there is a problem in Safari driver (binary file, that connects to Web Browser), because some time ago Mink Driver tests mostly worked on Safari.
I've found https://developer.apple.com/documentation/webkit/testing_with_webdriver_in_safari instruction for enabling Safari driver. Maybe you have enabled Safari Driver incorrectly.
bartonhammond commentedon Sep 20, 2018
I had already followed those steps, namely:
safaridriver --enableI don't see anything from that page that I haven't already done. The Safari browser does come up but it doesn't seem to work with equivalence to Chrome. All my tests pass w/o issue w/ Chrome.
aik099 commentedon Sep 20, 2018
Maybe you can record output from Selenium Server for Google Chrome and for Safari. This way we can clearly see all executed commands and which of them fails.
If for Safari same commands are executed and no error happens (just
findcall doesn't find anything), then maybe something different happens on a page in Safari (e.g. content, that is searched for is loaded later or via AJAX) and tests doesn't account for that.Try the
findoperation on very basic page: empty page and element is right there immediately. If that works, then theory I've explained above might be causing this.bartonhammond commentedon Sep 20, 2018
bartonhammond commentedon Sep 20, 2018
Is
vendor/bin/selenium-server-standalone --debuggood enough?bartonhammond commentedon Sep 20, 2018
Here is
chromelog fromselenium:and here is
safarilog fromseleniumaik099 commentedon Sep 20, 2018
Morelink was searched. Are you sure you've posted correct output.Really try testing on a basic page and just issue single
findcall.bartonhammond commentedon Sep 20, 2018
Argh - you're right....sorry - i'll do that now
bartonhammond commentedon Sep 20, 2018
Ok, the page I am testing now is http://crossbrowsertesting.github.io/login-form.html and looking only for one element, the id=
username.Here is the
safari- it fails with"username" element is not present on the page (SensioLabs\Behat\PageObjectExtension\PageObject\Exception\ElementNotFoundException)And here is the
chromeand it succeeds:stof commentedon Sep 20, 2018
https://developer.apple.com/documentation/webkit/macos_webdriver_commands_for_safari_12_and_later says that the Safari driver implements the W3C protocol. The PHP webdriver library we use is not yet compatible with the W3C protocol (which is not exactly the same than the older JsonWire protocol, as some changes were made during the standardization process)
bartonhammond commentedon Sep 20, 2018
When I do
I see there is the
--legacy- is there a way to forcesafaridriverto uselegacyas a workaround?stof commentedon Sep 20, 2018
Well, you could run safaridriver directly instead of using the selenium-server hub (as you probably don't need the hub). this is probably the easiest way to control this setting. I don't know whether the Selenium grid server allows to configure CLI flags used when launching browser drivers.
stof commentedon Sep 20, 2018
To run the browser driver directly as the selenium server, things are as easy as running it (
safaridriver --legacy --port 4444) and changing your Mink config to connect tohttp://127.0.0.1:4444instead ofhttp://127.0.0.1:4444/wd/hub(the grid server exposes the Webdriver protocol on/wd/hubdue to support for the older Selenium API, but browser drivers are exposing it at the root of their server)bartonhammond commentedon Sep 20, 2018
I will not be able to look at this until Monday. Thanks for your help @stof & @aik099
bartonhammond commentedon Sep 24, 2018
That works! Many Thanks @stof & @aik099 !!!