Please help! Errors with webdriver/python

137 views
Skip to first unread message

Elena Gasilina

unread,
Mar 6, 2016, 9:49:59 PM3/6/16
to Selenium Users

ERROR: test_1 (__main__.Test1)

----------------------------------------------------------------------

Traceback (most recent call last):

  File "test1.py", line 23, in test_1

    driver.find_element_by_link_text("Login").click()

  File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 282, in find_element_by_link_text

    return self.find_element(by=By.LINK_TEXT, value=link_text)

  File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 712, in find_element

    {'using': by, 'value': value})['value']

  File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 201, in execute

    self.error_handler.check_response(response)

  File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 194, in check_response

    raise exception_class(message, screen, stacktrace)

NoSuchElementException: Message: Unable to locate element: {"method":"link text","selector":"Login"}

Stacktrace:

    at FirefoxDriver.prototype.findElementInternal_ (file:///var/folders/xz/td457dt94m7001pgpht81bx00000gp/T/tmp869uIK/extensions/fxdr...@googlecode.com/components/driver-component.js:10723)

    at fxdriver.Timer.prototype.setTimeout/<.notify (file:///var/folders/xz/td457dt94m7001pgpht81bx00000gp/T/tmp869uIK/extensions/fxdr...@googlecode.com/components/driver-component.js:623)


----------------------------------------------------------------------

Ran 1 test in 44.475s


FAILED (errors=1)

Doug Dragon

unread,
Mar 7, 2016, 1:38:46 PM3/7/16
to Selenium Users
Can you also share the HTML of the element you're trying to click on? The error states selenium couldn't find a link with that text but seeing the HTML will help tell me why.

Thanks,

-Doug


On Sunday, March 6, 2016 at 9:49:59 PM UTC-5, Elena Gasilina wrote:

ERROR: test_1 (__main__.Test1)

----------------------------------------------------------------------

Traceback (most recent call last):

  File "test1.py", line 23, in test_1

    driver.find_element_by_link_text("Login").click()

  File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 282, in find_element_by_link_text

    return self.find_element(by=By.LINK_TEXT, value=link_text)

  File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 712, in find_element

    {'using': by, 'value': value})['value']

  File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 201, in execute

    self.error_handler.check_response(response)

  File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 194, in check_response

    raise exception_class(message, screen, stacktrace)

NoSuchElementException: Message: Unable to locate element: {"method":"link text","selector":"Login"}

Stacktrace:

    at FirefoxDriver.prototype.findElementInternal_ (file:///var/folders/xz/td457dt94m7001pgpht81bx00000gp/T/tmp869uIK/extensions/fxdrive...@googlecode.com/components/driver-component.js:10723)

    at fxdriver.Timer.prototype.setTimeout/<.notify (file:///var/folders/xz/td457dt94m7001pgpht81bx00000gp/T/tmp869uIK/extensions/fxdrive...@googlecode.com/components/driver-component.js:623)

Reply all
Reply to author
Forward
0 new messages