3

I have written Selenium script & it sucessfully executed on FF, chrome & IE. But when I tried it on Safari it gives error while clicking on button. I used Selenium-java-2.52 version jars & Safari version-5.1.7. Is there any solution to overcome with this?

It gives this type of error:

org.openqa.selenium.WebDriverException: 'undefined' is not a function (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 16 milliseconds
Build info: version: '2.49.0', revision: '365eeb44deba2067b1761c8862ef21d55250e063', time: '2016-01-13 11:57:39'
System info: host: 'comp-2', ip: '192.168.101.16', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.8.0_66'
Driver info: org.openqa.selenium.safari.SafariDriver
Capabilities [{browserName=safari, takesScreenshot=true, javascriptEnabled=true, version=5.1.7, cssSelectorsEnabled=true, platform=WINDOWS, secureSsl=true}]
Session ID: null

Is Windows- Safari always supports Selenium to run script?

  • Which type of browser is more supportive for Selenium- win-7- Safari or- MAC-OS Safari? – Bharat Mane Apr 6 '16 at 10:17
  • what kind of locators do you use? Xpath is notoriously fragile, but many people for strange reason prefer it (and complain about it). Source code? – Peter M. - stands for Monica Apr 11 '16 at 14:40
  • Actually I have used JavaScript in my coding for clicking Buttons withing ifrmae & it stops working at javaScript. – Bharat Mane Apr 12 '16 at 5:44
3

Question yourself if you really need to test on Safari on WINDOWS?

Safari on Windows has been discontinued since half 2013. I would say focus on the latest Safari on Mac OS X instead. The chance a windows user installing an old version of Safari is extremely small.

  • 1
    thanks @Niels. There is lots of error while working with win-Safari. but my current organization uses win-Safari & I need to run my complete script on Chrome, FF, IE & Safari. So in this situation what should I need to do? – Bharat Mane May 4 '16 at 7:12
  • 1
    In my script I also used javascript in many more methods & problem is that win-Safari does not supports with script containing "Javascript". Any option at this moment? – Bharat Mane May 4 '16 at 7:14
  • 1
    They should stop using Win-Safari within an production environment immediately! Since its not updated it has a lot of possible security issues, no IT department with a little sense should allow this. Also its not supported anymore also not with Selenium, I would not waste time on it. – Niels van Reijmersdal May 4 '16 at 7:20
0

One thing we found with Safari was that the button wasn't in site becuase it was 'below the fold' and you had to scroll down.

Our fix with to focus on a nearby element first before clicking.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.