Skip to content

Instantly share code, notes, and snippets.

@weissjeffm
Created March 28, 2014 19:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weissjeffm/9840840 to your computer and use it in GitHub Desktop.
Save weissjeffm/9840840 to your computer and use it in GitHub Desktop.
fun stack
---------------------------------------------------------------------------
NoSuchElementException Traceback (most recent call last)
<ipython-input-138-4e38883c4768> in <module>()
1 import cfme.login as login
2 with trace_on([sel]):
----> 3 login.login("admin", "smartvm")
4
/home/jweiss/workspace/cfme_tests/cfme/login.pyc in login(username, password, submit_method)
68 # TODO: Should probably do the username check here, but there are pretty usernames to deal with
69 # e.g. 'admin' shows up in the UI as 'Administrator'
---> 70 if not logged_in():
71 # workaround for strange bug where we are logged out
72 # as soon as we click something on the dashboard
/home/jweiss/workspace/cfme_tests/cfme/login.pyc in logged_in()
41
42 def logged_in():
---> 43 if sel.is_displayed(page.user_dropdown):
44 return True
45
<ipython-input-137-2967e82df9ac> in g(*args, **kwargs)
19 #print "Producing traced version of " + f.__name__
20 def g(*args, **kwargs):
---> 21 return tracer(f, *args, **kwargs)
22 return g
23
<ipython-input-137-2967e82df9ac> in tracer(f, *args, **kwargs)
7 indent_level += 1
8 try:
----> 9 r = f(*args, **kwargs)
10 except Exception as e:
11 r = e # print the exception as the return val
/home/jweiss/workspace/cfme_tests/cfme/fixtures/pytest_selenium.pyc in is_displayed(loc)
135 """
136 try:
--> 137 return element(loc).is_displayed()
138 except NoSuchElementException:
139 return False
<ipython-input-137-2967e82df9ac> in g(*args, **kwargs)
19 #print "Producing traced version of " + f.__name__
20 def g(*args, **kwargs):
---> 21 return tracer(f, *args, **kwargs)
22 return g
23
<ipython-input-137-2967e82df9ac> in tracer(f, *args, **kwargs)
7 indent_level += 1
8 try:
----> 9 r = f(*args, **kwargs)
10 except Exception as e:
11 r = e # print the exception as the return val
/home/jweiss/workspace/cfme_tests/cfme/fixtures/pytest_selenium.pyc in element(o, **kwargs)
98 matches = elements(o, **kwargs)
99 if not matches:
--> 100 raise NoSuchElementException("Element {} not found on page.".format(str(o)))
101 return matches[0]
102
NoSuchElementException: Message: 'Element //div[@id="page_header_div"]//li[contains(@class, "dropdown")] not found on page.'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment