MCPcopy Index your code
hub / github.com/tebeka/selenium / testFindElements

Function testFindElements

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

Source from the content-addressed store, hash-verified

1033}
1034
1035func testFindElements(t *testing.T, c config) {
1036 wd := newRemote(t, c)
1037 defer quitRemote(t, wd)
1038
1039 if err := wd.Get(serverURL); err != nil {
1040 t.Fatalf("wd.Get(%q) returned error: %v", serverURL, err)
1041 }
1042 elems, err := wd.FindElements(ByName, "q")
1043 if err != nil {
1044 t.Fatal(err)
1045 }
1046
1047 if len(elems) != 1 {
1048 t.Fatalf("Wrong number of elements %d (should be 1)", len(elems))
1049 }
1050
1051 we, ok := elems[0].(*remoteWE)
1052 if !ok {
1053 t.Fatal("Can't convert to *remoteWE")
1054 }
1055
1056 if len(we.id) == 0 {
1057 t.Fatal("Empty element")
1058 }
1059
1060 if we.parent != wd {
1061 t.Fatal("Bad parent")
1062 }
1063}
1064
1065func testSendKeys(t *testing.T, c config) {
1066 wd := newRemote(t, c)

Callers

nothing calls this directly

Calls 4

newRemoteFunction · 0.85
quitRemoteFunction · 0.85
GetMethod · 0.65
FindElementsMethod · 0.65

Tested by

no test coverage detected