1

I am trying to automate a login for my gmail account. I am able to catch email element with ID. But when I try to catch Password element, it is kind of tricky as their is no ID mentioned for that field. So I tried:

password=browser.find_element_by_css_selector(input(type=='password')).click()
        password.send_keys('********')
        login=browser.find_element_by_css_selector('.#passwordNext')
        login.click()

If I run it I get the following error:

[12660:8048:0417/023418.651:ERROR:shader_disk_cache.cc(238)] Failed to create shader cache entry: -2
[12660:8048:0417/023418.796:ERROR:shader_disk_cache.cc(238)] Failed to create shader cache entry: -2
[12660:8048:0417/023418.796:ERROR:shader_disk_cache.cc(238)] Failed to create shader cache entry: -2
False[12660:8048:0417/023419.951:ERROR:shader_disk_cache.cc(238)] Failed to create shader cache entry: -2

I am pretty new to selenium and python and stuck badly. Help will be much appreciated please.

  • I can see both dot and hash sign in the code. I am not an expert here but I think you need either of them depending upon the case. Use dot if passwordNext is class or use hash if it is an id. – Nabin Apr 17 '18 at 07:42
  • Possible duplicate of [Log into gmail using Selenium in Python](https://stackoverflow.com/questions/44856887/log-into-gmail-using-selenium-in-python) – undetected Selenium Apr 17 '18 at 07:46

2 Answers2

0

Use this code for Password field :

WebDriverWait(driver, 20).until(EC.visibility_of(By.ID,'headingText')  
browser.find_element_by_name('password')).send_Keys("jaspreet@stackoverflow");

try out this code and let me know the status.

cruisepandey
  • 28,520
  • 6
  • 20
  • 38
0

for password button there is ID associated with id "passwordNext" you can use that for password button click for verification on developer tab search with "#passwordNext" if you got result highlighted then you can use below code

browser.find_element_by_id('passwordNext').click()

mahesh
  • 9
  • 2
  • The password field actually has no ID defined, "passwordNext" is for the button after the password field,but I figured it out. Thanks! – jaspreet sohal Apr 17 '18 at 17:02