From b32e053049d4149d078207e594f064658dc9192a Mon Sep 17 00:00:00 2001 From: Jim Evans Date: Sun, 11 Nov 2018 11:54:55 -0800 Subject: [PATCH] Removing premature break statements in IE obscured element check When looping through the elements returned by elementsFromPoint, the driver was calling a break statement early, preventing clear error messages for which element is obscuring the element to be clicked. --- cpp/iedriver/Element.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cpp/iedriver/Element.cpp b/cpp/iedriver/Element.cpp index 5caf0895cad8b..b0614f4655864 100644 --- a/cpp/iedriver/Element.cpp +++ b/cpp/iedriver/Element.cpp @@ -347,7 +347,6 @@ bool Element::IsObscured(LocationInfo* click_location, } } - bool is_obscured = false; CComPtr elements_doc; hr = doc.QueryInterface(&elements_doc); if (FAILED(hr)) { @@ -358,7 +357,7 @@ bool Element::IsObscured(LocationInfo* click_location, return false; } - long top_most_element_index = -1; + bool is_obscured = false; CComPtr elements_hit; hr = elements_doc->elementsFromPoint(static_cast(x), static_cast(y), @@ -409,13 +408,11 @@ bool Element::IsObscured(LocationInfo* click_location, // it with the pointer device has no effect, so it is effectively // not obscuring this element. is_obscured = true; - break; } } else { // We were unable to retrieve the computed style, so we must assume // the other element is obscuring this one. is_obscured = true; - break; } } else { // Repeating the immediate-child-of-inline-element hack from above for