From 777912f501022a0e8c91eb08e90586ccf1047de7 Mon Sep 17 00:00:00 2001 From: "lilong.129" Date: Thu, 21 Sep 2023 19:52:23 +0800 Subject: [PATCH] fix: check popup exists --- hrp/pkg/uixt/popups.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hrp/pkg/uixt/popups.go b/hrp/pkg/uixt/popups.go index a1d01e07..cccd00d9 100644 --- a/hrp/pkg/uixt/popups.go +++ b/hrp/pkg/uixt/popups.go @@ -115,7 +115,10 @@ func (p *PopupInfo) isIdentical(lastPopup *PopupInfo) bool { } func (p *PopupInfo) exists() bool { - return p.PopupArea.IsEmpty() || p.CloseArea.IsEmpty() + if p.PopupArea.IsEmpty() || p.CloseArea.IsEmpty() { + return false + } + return true } func (dExt *DriverExt) ClosePopups(options ...ActionOption) error { @@ -149,7 +152,7 @@ func (dExt *DriverExt) ClosePopupsHandler(options ...ActionOption) error { popup := screenResult.Popup if popup == nil || !popup.exists() { - log.Debug().Msg("no popup found") + log.Debug().Interface("popup", popup).Msg("no popup found") break } popup.CloseStatus = CloseStatusFound