SELENIUM “SELENIUM.COMMON.EXCEPTIONS.NOSUCHELEMENTEXCEPTION” WHEN USING CHROME

120 views
Skip to first unread message

sajeev....@gmail.com

unread,
Jun 19, 2018, 6:27:09 AM6/19/18
to Selenium Users
C:\Users\CRAYONS\PycharmProjects\sample1\venv\Scripts\python.exe C:/Users/CRAYONS/PycharmProjects/sample1/seleniumscripts/secondseleniumscripts.py
Traceback (most recent call last):
  File "C:/Users/CRAYONS/PycharmProjects/sample1/seleniumscripts/secondseleniumscripts.py", line 17, in <module>
    username = driver.find_element_by_xpath("login[email]")
  File "C:\Python36-32\selenium\webdriver\remote\webdriver.py", line 387, in find_element_by_xpath
    return self.find_element(by=By.XPATH, value=xpath)
  File "C:\Python36-32\selenium\webdriver\remote\webdriver.py", line 957, in find_element
    'value': value})['value']
  File "C:\Python36-32\selenium\webdriver\remote\webdriver.py", line 314, in execute
    self.error_handler.check_response(response)
  File "C:\Python36-32\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"login[email]"}
  (Session info: chrome=67.0.3396.87)
  (Driver info: chromedriver=2.32.498550 (9dec58e66c31bcc53a9ce3c7226f0c1c5810906a),platform=Windows NT 6.1.7601 SP1 x86_64)


Process finished with exit code 1


i have a error so plz help me

ankit garg

unread,
Jun 19, 2018, 7:00:15 AM6/19/18
to seleniu...@googlegroups.com
Looks like xpath used is not correct

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/b7c9b139-8832-4702-88ad-538dc3c647a5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

total QA

unread,
Jun 20, 2018, 1:20:45 AM6/20/18
to Selenium Users
Hi,

NoSuchElementException occurs due to following reason.

1. Element properties are dynamic
2. Due to timeout issue
3. Element is in the frame/Iframe.

Regards,
Reply all
Reply to author
Forward
0 new messages