fix: screenshot with path

This commit is contained in:
lilong.129
2025-03-05 10:43:26 +08:00
parent 7539e456d7
commit 9e064ee0ad
3 changed files with 3 additions and 3 deletions

View File

@@ -254,11 +254,11 @@ func (ud *UIA2Driver) Orientation() (orientation types.Orientation, err error) {
func (ud *UIA2Driver) DoubleTap(x, y float64, opts ...option.ActionOption) error {
var err error
actionOptions := option.NewActionOptions(opts...)
x, y, err = convertToAbsolutePoint(ud, x, y)
if err != nil {
return err
}
actionOptions := option.NewActionOptions(opts...)
x, y = actionOptions.ApplyOffset(x, y)
data := map[string]interface{}{

View File

@@ -69,7 +69,7 @@ func (dExt *XTDriver) GetScreenResult(opts ...option.ActionOption) (screenResult
// get screenshot info with retry
for i := 0; i < 3; i++ {
imagePath = filepath.Join(config.GetConfig().ScreenShotsPath, fileName)
bufSource, err = dExt.ScreenShot()
bufSource, err = dExt.ScreenShot(option.WithScreenShotFileName(imagePath))
if err != nil {
lastErr = err
continue