MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / GoogleOneBox

Class GoogleOneBox

py/test/selenium/webdriver/common/google_one_box.py:25–47  ·  view source on GitHub ↗

This class models a page that has a google search bar.

Source from the content-addressed store, hash-verified

23
24
25class GoogleOneBox:
26 """This class models a page that has a google search bar."""
27
28 def __init__(self, driver, url):
29 self._driver = driver
30 self._url = url
31
32 def is_loaded(self):
33 try:
34 self._driver.find_elemen(By.NAME, "q")
35 return True
36 except NoSuchElementException:
37 return False
38
39 def load(self):
40 self._driver.get(self._url)
41
42 @require_loaded
43 def search_for(self, search_term):
44 element = self._driver.find_element(By.NAME, "q")
45 element.send_keys(search_term)
46 element.submit()
47 return ResultsPage(self._driver)

Callers 1

test_searchFunction · 0.90

Calls

no outgoing calls

Tested by 1

test_searchFunction · 0.72