I am new to selenium. I am trying to set my username in in gmail browser by using python2.6.
import unittest
from selenium import webdriver;
from selenium import WebElement;
driver = webdriver.Ie();
driver.get("http://www.gmail.com");
WebElement uname = driver.find_element(by=By,id("Username:"));
uname.sendKeys("chakry.gosetty");
With the above code I am getting
WebElement uname= driver.find_element(by=By,id("Username:"));
SyntaxError : Invalid syntax.
Please help me.
Rgds, G.Chakravarthy
How about...
import unittest
from selenium import webdriver
driver = webdriver.Ie()
driver.get('http://www.gmail.com')
driver.find_element_by_id('Email').send_keys('chakry.gosetty')
Email
not Username:
A guess: Apart from the other obvious syntax errors, you don't import By. How about this:
from selenium.webdriver.common.by import By
...
uname = driver.find_element(By.ID,value="...")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With