Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8773295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:15:31+00:00 2026-06-13T18:15:31+00:00

I have a problem with sending keys to the username and password fields in

  • 0

I have a problem with sending keys to the username and password fields in google’s sign in box. Selenium finds the webelements with the id’s “Email” and “Passwd”, but I cannot send any keys to them.

Here’s the code that isn’t yielding the expected results:

from selenium               import webdriver
#from selenium.webdriver.common.keys import Keys
import time

username = "test"
password = "ninja"


driver = webdriver.Firefox()
driver.get(u'http://www.google.com')

driver.implicitly_wait(10)

elem = driver.find_element_by_id("gb_70")
elem.click()

username = driver.find_element_by_id('Email')
username.send_keys(username)

This code generates an error:

Traceback (most recent call last):
File “SERPkopi.py”, line 18, in
username.send_keys(username)
File “/Users/Sverdrup/virtualenv-1.6.1/Alert/lib/python2.7/site- packages/selenium/webdriver/remote/webelement.py”, line 142, in send_keys
local_file = LocalFileDetector.is_local_file(*value)
File “/xxxxx/xxxxxx/virtualenv-1.6.1/Alert/lib/python2.7/site- packages/selenium/webdriver/remote/webelement.py”, line 253, in is_local_file
for i in range(len(val)):
TypeError: object of type ‘WebElement’ has no len()

Which is strange, because the same code can write to google’s ‘q’ (query) field

I’ve tried to identify the webElement by id, name, xpath to no avail.

Background as to why:

I got my eyes open for google alerts today and want to set up alerts on my company’s customer’s names (this is a business to business setup, so the customers are companies themselves). The customers are relatively small, and I do not imagine that I’ll get a lot of alerts on their names, but it would be great to be able to keep track of them.

Seeing as how there isn’t a API for google alerts, I thought I’d use selenium to programmatically enter the couple of hundred customers names. I first have to be able to log on to my account though…

I would realy appreciate all and any help given.

Sincerely

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T18:15:32+00:00Added an answer on June 13, 2026 at 6:15 pm

    So this may be a bittersweet answer, but your script is essentially fine. Here is the problem:

    username = "test"
    
    #....
    
    username = driver.find_element_by_id('Email')
    username.send_keys(username)
    

    You set username just fine, but you then go on to redefine it as the Email element, which then causes an error because of the final line – you are sending the username element back to itself as a string (which is the argument of send_keys), causing an Inception-like event of chaos. The len error is because Selenium is trying to take the length of the argument to send_keys, which it expects to be a string but is in this case an element. In order to fix it, simply change one of the variable names. For instance

    user_field = driver.find_element_by_id('Email')
    user_field.send_keys(username)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

greetings all i have a problem that when sending an email from the server
I have problem sending emails, i checked the email sending error logs, and I
I have a problem sending email from a linux machine. The application sends several
I have a problem sending a registration email via zend_mail. The mail is transmitted
I am a Rails noob and have a problem sending an email from a
I have a problem sending POST request with VB6. The code below works properly
I have a problem with sending POST http request. It stops on (HttpWebResponse)request.GetResponse() and
I have a problem with sending string via game center. I am able to
Hi I have a problem in sending data from php to pdf. I think
I have a problem when I want to sending data using byte format in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.