mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-07 08:12:41 +08:00
feat: 删除ui2 获取剪贴板
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user