Unable to run tests on Safari - Do we need dev certificate

冷暖自知 提交于 2019-12-21 19:56:47

问题


I am trying to run my protractor tests on Safari. While researching, I learnt that you need not download anything in specific for Safari when using protractor because the driver comes with it. When attempting to run my tests I was getting "No Safari driver" found message. Then I installed this extension for Safari - from the link below.

https://code.google.com/p/selenium/wiki/SafariDriver

http://selenium-release.storage.googleapis.com/index.html?path=2.45/

This extension does show up on preference - Extension on Safari. While running my tests, I initially get this and then it navigates to Blank window. Nothing happens after that... Do we have to buy the Apple dev subscription in order for us to use safari? I was hoping to run my appium tests on iOS devices and I doubt that Safari will work even with mobile browsers.

What are my options? Is paying the only way to get Safari work on a Mac?

I have MacBook Pro - Yosemite - 10.10.4 Safari - 8.0.7

[ 0.002s] [safaridriver.client] Connecting to SafariDriver browser extension... [ 0.002s] [safaridriver.client] This will fail if you have not installed the latest SafariDriver extension from http://selenium-release.storage.googleapis.com/index.html [ 0.003s] [safaridriver.client] Extension logs may be viewed by clicking the Selenium [✓] button on the Safari toolbar [ 0.005s] [safaridriver.client] Connected to extension [ 0.006s] [safaridriver.client] Requesting extension connect to client at ws://localhost:13871


回答1:


I had Selenium 2.45 installed, and this is what I did to get SafariDriver working on OS X 10.9.5 with Selenium 2.46:

  1. Uninstall current SafariDriver from Safari (Preferences > Extensions > WebDriver 2.45.0 > Uninstall)
  2. Download and unzip Selenium 2.46 for Java (http://selenium-release.storage.googleapis.com/2.46/selenium-java-2.46.0.zip)
  3. Unzip /selenium-2.46.0/selenium-java-2.46.0.jar
  4. Find and double-click /selenium-2.46.0/selenium-java-2.46.0/org/openqa/selenium/safari/SafariDriver.safariextz

This will install, what I believe is, SafariDriver 2.46.0. It will be listed in Safari as WebDriver 2.45.0, but the file date is newer, and it worked for me.



来源:https://stackoverflow.com/questions/31484045/unable-to-run-tests-on-safari-do-we-need-dev-certificate

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!