Clicking on svg on gmail login using selenium-python -
i trying test gmail login using selenium. want execute test case where:
loads url
enter email-id
- click on svg element takes me accounts being used on computer
i tried clicking on finding xpath using xpath helper throws me timeout exception. can please help?
import unittest selenium import webdriver selenium.webdriver.common.keys import keys selenium.webdriver.common.by import selenium.webdriver.support.ui import webdriverwait selenium.webdriver.support import expected_conditions ec selenium.common.exceptions import nosuchelementexception class gmail(unittest.testcase): def setup(self): self.driver = webdriver.chrome() self.driver.get("http://www.gmail.com") def test_1(self): driver=self.driver try: print "entering email-id" self.email_id=driver.find_element_by_name("identifier") self.email_id.clear() self.email_id.send_keys("shivamconan@gmail.com") self.email_id.send_keys(keys.return) except nosuchelementexception e: "email field not found" try: self.arrow = webdriverwait(driver,30).until(ec.presence_of_element_located((by.xpath,"/html[@class='cmgtxc']/body[@id='ydmh0d']/div[@class='uc81ff wkbl8c']/div[@id='initialview']/div[@class='bdf4dc']/div[@id='view_container']/form[@class='rfjusb bxpayd k6zj8d']/div[@class='hmxfuf']/div/div[@class='fgbzld r5i3od']/div[2]/div[@class='mubcce fkz7od yybxpf keavsb m9bg4d']/content[@class='xjkilb']/span/span/svg[@class='[object svganimatedstring]']"))) self.arrow.click() print "clicked" except: print "not clicked"
Comments
Post a Comment