(frame interface{})
| 867 | } |
| 868 | |
| 869 | func (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 | |
| 892 | func (wd *remoteWD) ActiveElement() (WebElement, error) { |
| 893 | verb := "GET" |
nothing calls this directly
no test coverage detected