Safari (12.1) Webdriver hard crash on Selenium cli

2019-08-21 23:14发布

When I'm running my selenium scripts, I will get a hard crash when I run the Safari web browser if I click certain links.

For most click actions the Safari Webdriver is fine, but if I preform a webElement.click() or webElement.actions.clickAndHold([some web element]).perform() The driver will crash.

This only happens for web elements that are footer jump links (like, when a user clicks on the link the page will scroll down to the footer).

Also, this only happens in Safari. Chrome, Firefox, etc. are all fine.

Has anyone run into something like this, and if so are there work arounds (like maybe some other way to click a web element)?

This started with the newly released Safari 12.1.1 browser (it was working fine before)

I think this is the section of the Javascript on the webpage that is causing the crash:

        $.each(t, function(n, t) {
            var i = $(t)
              , r = p(i);
            r && r.not("[tabindex],input,textarea").attr("tabindex", -1);
            r && (i.data("anchor") ? console.warn("%c attr [data-anchor] is deprecated; use [href] or [data-jump-target] instead", "background: #222; color: #7fda55; font-size: 14px; padding: 4px", i[0]) : i.is(".jumpLink, .anchor-link, .superscript-link") && console.warn('%c classes .jumpLink, .anchor-link, .superscript-link for anchors are deprecated; use <a href="#value"> or <div data-jump-target="value"> instead', "background: #222; color: #7fda55; font-size: 12px; padding: 2px", i[0]))
        });

And this is the error Safari is throwing:

Process:               Safari [24240]
Path:                  /Applications/Safari.app/Contents/MacOS/Safari
Identifier:            com.apple.Safari
Version:               12.1.1 (14607.2.6.1.1)
Build Info:            WebBrowser-7607002006001001~3
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           Safari [24240]
User ID:               502

Date/Time:             2019-06-21 15:16:23.521 -0600
OS Version:            Mac OS X 10.14.5 (18F203)
Report Version:        12
Bridge OS Version:     3.5 (16P5200)
Anonymous UUID:        56C84AF4-983B-688C-12EB-52065287562D

Sleep/Wake UUID:       6B696843-31A9-4795-B29B-E3D128CE40A4

Time Awake Since Boot: 57000 seconds
Time Since Wake:       720 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes:       0x0000000000000001, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Illegal instruction: 4
Termination Reason:    Namespace SIGNAL, Code 0x4
Terminating Process:   exc handler [24240]

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   com.apple.WebKit                0x00007fff49065320 WTF::Function<void (WTF::Optional<WebCore::IntPoint>, WTF::Optional<WebKit::AutomationCommandError>)>::CallableWrapper<WebKit::SimulatedInputDispatcher::resolveLocation(WebCore::IntPoint const&, WTF::Optional<WebCore::IntPoint>, Inspector::Protocol::Automation::MouseMoveOrigin, WTF::Optional<WTF::String>, WTF::Function<void (WTF::Optional<WebCore::IntPoint>, WTF::Optional<WebKit::AutomationCommandError>)>&&)::$_2>::call(WTF::Optional<WebCore::IntPoint>, WTF::Optional<WebKit::AutomationCommandError>) + 346
1   com.apple.WebKit                0x00007fff49053bd6 WTF::Function<void (WTF::Optional<WebCore::IntPoint>, WTF::Optional<WebKit::AutomationCommandError>)>::operator()(WTF::Optional<WebCore::IntPoint>, WTF::Optional<WebKit::AutomationCommandError>) const + 72
2   com.apple.WebKit                0x00007fff4905a707 WebKit::WebAutomationSession::didComputeElementLayout(unsigned long long, WebCore::IntRect, WTF::Optional<WebCore::IntPoint>, bool, WTF::String const&) + 1283
3   com.apple.WebKit                0x00007fff49161b12 void IPC::callMemberFunctionImpl<WebKit::WebAutomationSession, void (WebKit::WebAutomationSession::*)(unsigned long long, WebCore::IntRect, WTF::Optional<WebCore::IntPoint>, bool, WTF::String const&), std::__1::tuple<unsigned long long, WebCore::IntRect, WTF::Optional<WebCore::IntPoint>, bool, WTF::String>, 0ul, 1ul, 2ul, 3ul, 4ul>(WebKit::WebAutomationSession*, void (WebKit::WebAutomationSession::*)(unsigned long long, WebCore::IntRect, WTF::Optional<WebCore::IntPoint>, bool, WTF::String const&), std::__1::tuple<unsigned long long, WebCore::IntRect, WTF::Optional<WebCore::IntPoint>, bool, WTF::String>&&, std::__1::integer_sequence<unsigned long, 0ul, 1ul, 2ul, 3ul, 4ul>) + 91
4   com.apple.WebKit                0x00007fff491615f0 void IPC::handleMessage<Messages::WebAutomationSession::DidComputeElementLayout, WebKit::WebAutomationSession, void (WebKit::WebAutomationSession::*)(unsigned long long, WebCore::IntRect, WTF::Optional<WebCore::IntPoint>, bool, WTF::String const&)>(IPC::Decoder&, WebKit::WebAutomationSession*, void (WebKit::WebAutomationSession::*)(unsigned long long, WebCore::IntRect, WTF::Optional<WebCore::IntPoint>, bool, WTF::String const&)) + 99
5   com.apple.WebKit                0x00007fff48e0e9b6 IPC::MessageReceiverMap::dispatchMessage(IPC::Connection&, IPC::Decoder&) + 64

(there's more to the error message, this is only the top half).

1条回答
够拽才男人
2楼-- · 2019-08-21 23:33

I'm seeing the same crash when using the Action class to perform a shift-click. I broke the chained action into its separate parts and for me, it crashes at Action.KeyDown(elem, Keys.Shift).Perform()

I've been messing with this off and on for two days with no real progress.

查看更多
登录 后发表回答