selenium-google-code-issue-archive icon indicating copy to clipboard operation
selenium-google-code-issue-archive copied to clipboard

IEdriver crashes intermittently when waiting for element to be clickable after page reload is triggered by accepting alert

Open lukeis opened this issue 8 years ago • 6 comments

Originally reported on Google Code with ID 8453

Providing wiremock configuration and a testcase in java. Running the bat file included
and executing the testcase almost always crashes IEdriver for me. Happens both with
IE10 and 11. The 300ms delay configured for server responses triggers crash while 0
does not. It may be that running on a different machine you need more or less delay.
The testcase is minimized from an internal web app which also occasionally crashes
the driver.

Selenium version: 2.44.0
OS: Windows 7 64bit
Browser: IE10/11
IEDriver 2.44.0 32bit

Reported by merikes on 2015-02-03 12:26:49


- _Attachment: [AlertCrash.zip](https://storage.googleapis.com/google-code-attachments/selenium/issue-8453/comment-0/AlertCrash.zip)_

lukeis avatar Mar 04 '16 09:03 lukeis

When I enable logging results vary. Last time it was
T 2015-02-03 14:50:08:143 Element.cpp(896) Entering Element::GetContainingDocument
D 2015-02-03 14:50:08:165 Element.cpp(556) Element is not in a frame
T 2015-02-03 14:50:08:165 Element.cpp(845) Entering Element::CalculateClickPoint
T 2015-02-03 14:50:08:165 Element.cpp(784) Entering Element::GetClickableViewPortLocation
T 2015-02-03 14:50:08:165 Element.cpp(896) Entering Element::GetContainingDocument
T 2015-02-03 14:50:08:166 DocumentHost.cpp(392) Entering DocumentHost::GetDocumentMode
D 2015-02-03 14:50:08:167 DocumentHost.cpp(396) QueryInterface for IHTMLDocument6 fails,
so document mode must be 7 or less.
W 2015-02-03 14:50:08:168 Element.cpp(817) Document containing element does not contains
frames, but getting the documentElement property failed, or the doctype has thrown
the browser into pre-IE6 rendering. The view port calculation may be inaccurate
T 2015-02-03 14:50:08:168 DocumentHost.cpp(431) Entering DocumentHost::GetDocumentDimensions
T 2015-02-03 14:50:08:168 DocumentHost.cpp(410) Entering DocumentHost::IsStandardsMode
W 2015-02-03 14:50:08:168 DocumentHost.cpp(414) Unable to cast document to IHTMLDocument5.
IE6 or greater is required.
W 2015-02-03 14:50:08:169 DocumentHost.cpp(441) Unable to get canvas element from document
in compatibility mode
T 2015-02-03 14:50:08:169 Element.cpp(871) Entering Element::IsLocationInViewPort
T 2015-02-03 14:50:08:169 Element.cpp(784) Entering Element::GetClickableViewPortLocation
T 2015-02-03 14:50:08:169 Element.cpp(896) Entering Element::GetContainingDocument
T 2015-02-03 14:50:08:176 DocumentHost.cpp(392) Entering DocumentHost::GetDocumentMode
T 2015-02-03 14:50:09:629 Browser.cpp(281) Entering Browser::DetachEvents

Before that it was about unsupported interface:
T 2015-02-03 14:48:50:919 Element.cpp(896) Entering Element::GetContainingDocument
T 2015-02-03 14:48:50:920 Script.cpp(41) Entering Script::Initialize
T 2015-02-03 14:48:50:920 Script.cpp(91) Entering Script::AddArgument(IHTMLElement*)
T 2015-02-03 14:48:50:920 Script.cpp(97) Entering Script::AddArgument(VARIANT)
T 2015-02-03 14:48:50:920 Script.cpp(161) Entering Script::Execute
T 2015-02-03 14:48:50:920 Script.cpp(469) Entering Script::CreateAnonymousFunction
T 2015-02-03 14:48:50:942 Script.cpp(425) Entering Script::ConvertResultToString
D 2015-02-03 14:48:50:942 Script.cpp(436) Result type is string
D 2015-02-03 14:48:50:943 Element.cpp(348) (x, y, w, h): 8, 8, 53, 23
T 2015-02-03 14:48:50:943 Element.cpp(845) Entering Element::CalculateClickPoint
T 2015-02-03 14:48:50:943 Element.cpp(784) Entering Element::GetClickableViewPortLocation
T 2015-02-03 14:48:50:943 Element.cpp(896) Entering Element::GetContainingDocument
W 2015-02-03 14:48:50:945 Element.cpp(926) -2147467262 [Sellisel liidesel puudub tugi]:
Found document but it's not the expected type (IHTMLDocument2)
T 2015-02-03 14:48:50:945 DocumentHost.cpp(392) Entering DocumentHost::GetDocumentMode
T 2015-02-03 14:48:54:631 Browser.cpp(281) Entering Browser::DetachEvents

Reported by merikes on 2015-02-03 12:57:31

lukeis avatar Mar 04 '16 09:03 lukeis

Reported by barancev on 2015-02-13 08:12:40

  • Labels added: Browser-IE

lukeis avatar Mar 04 '16 09:03 lukeis

Please retest with IEDriverServer v.2.45

Reported by barancev on 2015-03-20 20:37:44

  • Status changed: NeedsClarification

lukeis avatar Mar 04 '16 09:03 lukeis

Still crashes, log ends with:
D 2015-03-23 10:45:51:418 command.cc(33) Raw JSON command: { "name" : "click", "locator"
: { "sessionid" : "c1677b1c-5bff-40d0-ae68-2a72c04b523c", "id" : "a4abb805-a591-4e44-ab51-ee686e4ca03d"
}, "parameters" : {"id":"a4abb805-a591-4e44-ab51-ee686e4ca03d"} }
T 2015-03-23 10:45:51:418 IESession.cpp(233) Beginning wait for response length to
be not zero
T 2015-03-23 10:45:51:418 IECommandExecutor.cpp(169) Entering IECommandExecutor::OnExecCommand
T 2015-03-23 10:45:51:418 IECommandExecutor.cpp(470) Entering IECommandExecutor::DispatchCommand
T 2015-03-23 10:45:51:418 IECommandExecutor.cpp(586) Entering IECommandExecutor::GetCurrentBrowser
T 2015-03-23 10:45:51:418 IECommandExecutor.cpp(592) Entering IECommandExecutor::GetManagedBrowser
T 2015-03-23 10:45:51:418 IECommandExecutor.cpp(542) Entering IECommandExecutor::IsAlertActive
T 2015-03-23 10:45:51:418 Browser.cpp(679) Entering Browser::GetActiveDialogWindowHandle
T 2015-03-23 10:45:51:418 Browser.cpp(192) Entering Browser::GetContentWindowHandle
D 2015-03-23 10:45:51:419 IECommandExecutor.cpp(556) No alert handle is found
T 2015-03-23 10:45:51:419 IECommandExecutor.cpp(586) Entering IECommandExecutor::GetCurrentBrowser
T 2015-03-23 10:45:51:419 IECommandExecutor.cpp(592) Entering IECommandExecutor::GetManagedBrowser
T 2015-03-23 10:45:51:419 IECommandHandler.cpp(37) Entering IECommandHandler::GetElement
T 2015-03-23 10:45:51:419 IECommandExecutor.cpp(679) Entering IECommandExecutor::GetManagedElement
T 2015-03-23 10:45:51:419 ElementRepository.cpp(28) Entering ElementRepository::GetManagedElement
T 2015-03-23 10:45:51:422 IECommandExecutor.cpp(586) Entering IECommandExecutor::GetCurrentBrowser
T 2015-03-23 10:45:51:422 IECommandExecutor.cpp(592) Entering IECommandExecutor::GetManagedBrowser
T 2015-03-23 10:45:51:422 Browser.cpp(112) Entering Browser::GetDocument
I 2015-03-23 10:45:51:422 Browser.cpp(116) No child frame focus. Focus is on top-level
frame
T 2015-03-23 10:45:51:431 Browser.cpp(579) Entering Browser::GetDocumentFromWindow
T 2015-03-23 10:45:51:436 InputManager.cpp(62) Entering InputManager::PerformInputSequence
D 2015-03-23 10:45:51:436 InputManager.cpp(83) Mutex acquired for user interaction.
T 2015-03-23 10:45:51:436 InputManager.cpp(436) Entering InputManager::MouseMoveTo
T 2015-03-23 10:45:51:436 ElementRepository.cpp(28) Entering ElementRepository::GetManagedElement
T 2015-03-23 10:45:51:436 Element.cpp(208) Entering Element::GetClickLocation
T 2015-03-23 10:45:51:436 Element.cpp(81) Entering Element::IsDisplayed
T 2015-03-23 10:45:51:436 Element.cpp(896) Entering Element::GetContainingDocument
T 2015-03-23 10:45:51:437 Script.cpp(41) Entering Script::Initialize
T 2015-03-23 10:45:51:437 Script.cpp(91) Entering Script::AddArgument(IHTMLElement*)
T 2015-03-23 10:45:51:437 Script.cpp(97) Entering Script::AddArgument(VARIANT)
T 2015-03-23 10:45:51:437 Script.cpp(80) Entering Script::AddArgument(bool)
T 2015-03-23 10:45:51:437 Script.cpp(97) Entering Script::AddArgument(VARIANT)
T 2015-03-23 10:45:51:437 Script.cpp(161) Entering Script::Execute
T 2015-03-23 10:45:51:437 Script.cpp(469) Entering Script::CreateAnonymousFunction
T 2015-03-23 10:45:51:473 Element.cpp(302) Entering Element::GetLocationOnceScrolledIntoView
T 2015-03-23 10:45:51:473 Element.cpp(433) Entering Element::GetLocation
T 2015-03-23 10:45:51:473 Element.cpp(569) Entering Element::IsInline
D 2015-03-23 10:45:51:476 Element.cpp(479) Element is a block element, using IHTMLElement2::getBoundingClientRect
W 2015-03-23 10:45:51:491 Element.cpp(494) -2147467259 [M奲amata viga]: Cannot figure
out where the element is on screen, client rect retrieval failed
T 2015-03-23 10:45:51:491 Element.cpp(845) Entering Element::CalculateClickPoint
T 2015-03-23 10:45:51:491 Element.cpp(784) Entering Element::GetClickableViewPortLocation
T 2015-03-23 10:45:51:491 Element.cpp(896) Entering Element::GetContainingDocument
T 2015-03-23 10:45:51:493 DocumentHost.cpp(401) Entering DocumentHost::GetDocumentMode
T 2015-03-23 10:45:53:899 Browser.cpp(87) Entering Browser::DocumentComplete
T 2015-03-23 10:45:53:900 Browser.cpp(286) Entering Browser::DetachEvents

Reported by merikes on 2015-03-23 08:55:53

lukeis avatar Mar 04 '16 09:03 lukeis

It's likely I can paper over the crash. I think I see where the problem is, but there
will still be a race condition with the DOM disappearing and reappearing out from underneath
the driver. Finding a "true" fix would likely require either (a) rearchitecting the
driver significantly to handle a disappearing DOM during a click operation like this,
or (b) adding validity checks to every operation, which would be so computationally
expensive as to render the driver unusable. I'm not saying these are not necessarily
options we wouldn't want to pursue, just that they won't be happening anytime in the
near future. In the meantime, I believe I'll be able to make it so the driver doesn't
actually crash in this case.

Reported by james.h.evans.jr on 2015-03-23 10:10:02

  • Status changed: Accepted
  • Labels removed: Status-Untriaged

lukeis avatar Mar 04 '16 09:03 lukeis

Reported by luke.semerau on 2015-09-17 17:47:30

  • Labels added: Restrict-AddIssueComment-Commit

lukeis avatar Mar 04 '16 09:03 lukeis