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

Function testExtendedErrorMessage

remote_test.go:684–709  ·  view source on GitHub ↗
(t *testing.T, c config)

Source from the content-addressed store, hash-verified

682}
683
684func testExtendedErrorMessage(t *testing.T, c config) {
685 // Bypass NewRemote which itself calls NewSession internally.
686 wd := &remoteWD{
687 capabilities: newTestCapabilities(t, c),
688 urlPrefix: c.addr,
689 }
690
691 var want string
692 switch {
693 case c.sauce != nil:
694 want = "404 Not Found"
695 case c.seleniumVersion.Major == 3:
696 want = "invalid session id:"
697 case c.browser == "firefox" && c.seleniumVersion.Major == 2:
698 want = "unknown error:"
699 case c.browser == "firefox" && c.seleniumVersion.Major == 0:
700 want = "unknown command"
701 case c.browser == "chrome":
702 want = "invalid session id:"
703 default:
704 want = "invalid session ID:"
705 }
706 if err := wd.Close(); err == nil || !strings.HasPrefix(err.Error(), want) {
707 t.Fatalf("Got error %q, expected error to start with %q", err, want)
708 }
709}
710
711// TODO(ekg): does this method work anymore in any browser? It is not part of
712// the W3C standard.

Callers

nothing calls this directly

Calls 3

CloseMethod · 0.95
newTestCapabilitiesFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…