Skip to content

Commit 2b3c8b7

Browse files
committed
fixed incorrect behaviour GetElementScreenShot command for not visible elements
1 parent 6905a18 commit 2b3c8b7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/webdriver/extension_qt/web_view_executor.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,13 @@ void QWebViewCmdExecutor::CanHandleUrl(const std::string& url, bool* can, Error
111111
void QWebViewCmdExecutor::GetElementScreenShot(const ElementId& element, std::string* png, Error** error) {
112112
CHECK_VIEW_EXISTANCE
113113

114+
bool is_displayed = false;
115+
*error = webkitProxy_->IsElementDisplayed(element, true, &is_displayed);
116+
if (!is_displayed) {
117+
*error = new Error(kElementNotVisible);
118+
return;
119+
}
120+
114121
Point location;
115122
*error = webkitProxy_->GetElementLocationInView(element, &location);
116123
if (*error)

0 commit comments

Comments
 (0)