feat: 删除ui2 获取剪贴板

This commit is contained in:
余泓铮
2025-07-24 17:34:02 +08:00
parent 8b20fceb63
commit ac77975c18

View File

@@ -574,28 +574,6 @@ func (ud *UIA2Driver) SetPasteboard(contentType types.PasteboardType, content st
return
}
func (ud *UIA2Driver) GetPasteboard() (content string, err error) {
// register(postHandler, new GetClipboard("/wd/hub/session/:sessionId/appium/device/get_clipboard"))
data := map[string]interface{}{
"contentType": types.PasteboardTypePlaintext,
}
var rawResp DriverRawResponse
urlStr := fmt.Sprintf("/session/%s/appium/device/get_clipboard", ud.Session.ID)
if rawResp, err = ud.Session.POST(data, urlStr); err != nil {
return "", err
}
reply := new(struct{ Value string })
if err = json.Unmarshal(rawResp, reply); err != nil {
return "", err
}
if data, err := base64.StdEncoding.DecodeString(reply.Value); err != nil {
return reply.Value, nil
} else {
return string(data), nil
}
}
// SendKeys Android input does not support setting frequency.
func (ud *UIA2Driver) Input(text string, opts ...option.ActionOption) (err error) {
log.Info().Str("text", text).Msg("UIA2Driver.Input")