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

Function testExecuteScript

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

Source from the content-addressed store, hash-verified

1367}
1368
1369func testExecuteScript(t *testing.T, c config) {
1370 wd := newRemote(t, c)
1371 defer quitRemote(t, wd)
1372
1373 if err := wd.Get(serverURL); err != nil {
1374 t.Fatalf("wd.Get(%q) returned error: %v", serverURL, err)
1375 }
1376 script := "return arguments[0] + arguments[1]"
1377 args := []interface{}{1, 2}
1378 reply, err := wd.ExecuteScript(script, args)
1379 if err != nil {
1380 t.Fatal(err)
1381 }
1382
1383 result, ok := reply.(float64)
1384 if !ok {
1385 t.Fatal("Not an int reply")
1386 }
1387
1388 if result != 3 {
1389 t.Fatalf("Bad result %d (expected 3)", int(result))
1390 }
1391}
1392
1393func testExecuteScriptWithNilArgs(t *testing.T, c config) {
1394 wd := newRemote(t, c)

Callers

nothing calls this directly

Calls 4

newRemoteFunction · 0.85
quitRemoteFunction · 0.85
GetMethod · 0.65
ExecuteScriptMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…