-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add the 1st selenium examples. SUT will be done later #1
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
selenium2.py
passed without any error, hooray!
Now we need to fix the rest.
def test_login(self): | ||
driver = self.driver | ||
driver.get("http://manage.mcafee.com") | ||
assert "Log On" in driver.title |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Failed test
F
======================================================================
FAIL: test_login (__main__.ePO_login)
----------------------------------------------------------------------
Traceback (most recent call last):
File "ePO_Login.py", line 43, in test_login
assert "Log On" in driver.title
AssertionError
----------------------------------------------------------------------
Ran 1 test in 3.880s
FAILED (failures=1)
tree = ET.parse('SiteElement.xml') | ||
root = tree.getroot() | ||
|
||
def getSearchValue(pagenameattribute, elementkeystring): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please fix pep8 error for this file selenium2.py
.
|
||
|
||
class PythonOrgSearch(unittest.TestCase): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EE.
======================================================================
ERROR: test_explicit_wait (__main__.PythonOrgSearch)
----------------------------------------------------------------------
Traceback (most recent call last):
File "selenium1.py", line 42, in test_explicit_wait
EC.presence_of_element_located((By.ID, "myDynamicElement")))
File "/home/zexi/pyenvs/iclp3test/lib/python3.4/site-packages/selenium/webdriver/support/wait.py", line 80, in until
raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message:
Stacktrace:
at FirefoxDriver.prototype.findElementInternal_ (file:///tmp/tmp28b4_2lv/extensions/[email protected]/components/driver-component.js:10770)
at FirefoxDriver.prototype.findElement (file:///tmp/tmp28b4_2lv/extensions/[email protected]/components/driver-component.js:10779)
at DelayedCommand.prototype.executeInternal_/h (file:///tmp/tmp28b4_2lv/extensions/[email protected]/components/command-processor.js:12661)
at DelayedCommand.prototype.executeInternal_ (file:///tmp/tmp28b4_2lv/extensions/[email protected]/components/command-processor.js:12666)
at DelayedCommand.prototype.execute/< (file:///tmp/tmp28b4_2lv/extensions/[email protected]/components/command-processor.js:12608)
======================================================================
ERROR: test_implicit_wait (__main__.PythonOrgSearch)
----------------------------------------------------------------------
Traceback (most recent call last):
File "selenium1.py", line 48, in test_implicit_wait
myDynamicElement = driver.find_element_by_id("myDynamicElement")
File "/home/zexi/pyenvs/iclp3test/lib/python3.4/site-packages/selenium/webdriver/remote/webdriver.py", line 269, in find_element_by_id
return self.find_element(by=By.ID, value=id_)
File "/home/zexi/pyenvs/iclp3test/lib/python3.4/site-packages/selenium/webdriver/remote/webdriver.py", line 752, in find_element
'value': value})['value']
File "/home/zexi/pyenvs/iclp3test/lib/python3.4/site-packages/selenium/webdriver/remote/webdriver.py", line 236, in execute
self.error_handler.check_response(response)
File "/home/zexi/pyenvs/iclp3test/lib/python3.4/site-packages/selenium/webdriver/remote/errorhandler.py", line 192, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: {"method":"id","selector":"myDynamicElement"}
Stacktrace:
at FirefoxDriver.prototype.findElementInternal_ (file:///tmp/tmpcasyjxa_/extensions/[email protected]/components/driver-component.js:10770)
at fxdriver.Timer.prototype.setTimeout/<.notify (file:///tmp/tmpcasyjxa_/extensions/[email protected]/components/driver-component.js:625)
----------------------------------------------------------------------
Ran 3 tests in 26.584s
FAILED (errors=2)
form = PageElement(tag_name='form') | ||
|
||
|
||
driver = webdriver.PhantomJS() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is phantomjs? any traps for installation on Linux 64, Mac, and Windows?
value = element.find('value').text | ||
return value | ||
|
||
def getSearchBy(pagenameattribute, elementkeystring): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getSearchBy()
never used?
No description provided.