MCPcopy Create free account
hub / github.com/tebeka/selenium / SwitchFrame

Method SwitchFrame

remote.go:869–890  ·  view source on GitHub ↗
(frame interface{})

Source from the content-addressed store, hash-verified

867}
868
869func (wd *remoteWD) SwitchFrame(frame interface{}) error {
870 params := map[string]interface{}{}
871 switch f := frame.(type) {
872 case WebElement, int, nil:
873 params["id"] = f
874 case string:
875 if f == "" {
876 params["id"] = nil
877 } else if wd.w3cCompatible {
878 e, err := wd.FindElement(ByID, f)
879 if err != nil {
880 return err
881 }
882 params["id"] = e
883 } else { // Legacy, non W3C-spec behavior.
884 params["id"] = f
885 }
886 default:
887 return fmt.Errorf("invalid type %T", frame)
888 }
889 return wd.voidCommand("/session/%s/frame", params)
890}
891
892func (wd *remoteWD) ActiveElement() (WebElement, error) {
893 verb := "GET"

Callers

nothing calls this directly

Calls 2

FindElementMethod · 0.95
voidCommandMethod · 0.95

Tested by

no test coverage detected