From a71cbfaa77b6d916dd89374b1674b1ccba44d683 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=99=E6=B3=93=E9=93=AE?= Date: Mon, 14 Jul 2025 14:55:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E6=88=AA=E5=9B=BE?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E8=BF=87=E9=95=BF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uixt/driver_ext_tap.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/uixt/driver_ext_tap.go b/uixt/driver_ext_tap.go index 0b36afcd..03722395 100644 --- a/uixt/driver_ext_tap.go +++ b/uixt/driver_ext_tap.go @@ -2,17 +2,20 @@ package uixt import ( "fmt" + "time" + + "github.com/rs/zerolog/log" "github.com/httprunner/httprunner/v5/uixt/ai" "github.com/httprunner/httprunner/v5/uixt/option" - "github.com/rs/zerolog/log" ) func (dExt *XTDriver) TapByOCR(text string, opts ...option.ActionOption) error { actionOptions := option.NewActionOptions(opts...) log.Info().Str("text", text).Interface("options", actionOptions).Msg("TapByOCR") + if actionOptions.ScreenShotFileName == "" { - opts = append(opts, option.WithScreenShotFileName(fmt.Sprintf("tap_by_ocr_%s", text))) + opts = append(opts, option.WithScreenShotFileName(fmt.Sprintf("%s_tap_by_ocr_%s", dExt.GetDevice().UUID(), time.Now().Format("20060102150405")))) } textRect, err := dExt.FindScreenText(text, opts...)