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

Function testActiveElement

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

Source from the content-addressed store, hash-verified

1605}
1606
1607func testActiveElement(t *testing.T, c config) {
1608 if c.browser == "htmlunit" {
1609 // TODO(minusnine): figure out why ActiveElement doesn't work in HTMLUnit.
1610 t.Skip("ActiveElement does not work in HTMLUnit")
1611 }
1612 wd := newRemote(t, c)
1613 defer quitRemote(t, wd)
1614
1615 if err := wd.Get(serverURL); err != nil {
1616 t.Fatalf("wd.Get(%q) returned error: %v", serverURL, err)
1617 }
1618
1619 e, err := wd.ActiveElement()
1620 if err != nil {
1621 t.Fatalf("wd.ActiveElement() returned error: %v", err)
1622 }
1623 name, err := e.GetAttribute("name")
1624 if err != nil {
1625 t.Fatalf("wd.ActiveElement().GetAttribute() returned error: %v", err)
1626 }
1627 if name != "q" {
1628 t.Fatalf("wd.ActiveElement().GetAttribute() returned element with name = %q, expected name = 'q'", name)
1629 }
1630}
1631
1632func testKeyDownUp(t *testing.T, c config) {
1633 wd := newRemote(t, c)

Callers

nothing calls this directly

Calls 5

newRemoteFunction · 0.85
quitRemoteFunction · 0.85
GetMethod · 0.65
ActiveElementMethod · 0.65
GetAttributeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…