TA的每日心情 | 开心 2017-2-23 09:15 |
---|
签到天数: 13 天 连续签到: 1 天 [LV.3]测试连长
|
# -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import NoAlertPresentException
import unittest, time, re
class test(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Chrome()
self.driver.implicitly_wait(30)
self.base_url = "http://test.robotscloud.com/"
self.verificationErrors = []
self.accept_next_alert = True
def test_(self):
driver = self.driver
driver.get(self.base_url + "/")
driver.find_element_by_id("email").clear()
driver.find_element_by_id("email").send_keys("cylan1234567@163.com")
driver.find_element_by_id("password").clear()
driver.find_element_by_id("password").send_keys("123456")
driver.find_element_by_id("check").clear()
driver.find_element_by_id("check").send_keys("2222")
driver.find_element_by_id("submit").click()
driver.find_element_by_link_text(u"企业信息").click()
driver.find_element_by_link_text(u"账号设置").click()
time.sleep(2)
driver.find_element_by_xpath(//*[@id="account_detail"]/div[1]/table/tbody/tr[2]/td[2]/div[1]/a).click()
time.sleep(2)
driver.find_element_by_id("companyname").clear()
time.sleep(3)
driver.find_element_by_id("companyname").send_keys(u"163邮箱1234567")
driver.find_element_by_id("nikename").clear()
driver.find_element_by_id("nikename").send_keys(u"163邮箱的1234567")
driver.find_element_by_css_selector("btn btn-green qiye").click()
driver.find_element_by_xpath(u"(//a[contains(text(),'设置')])[6]").click()
driver.find_element_by_id("organization_code").clear()
driver.find_element_by_id("organization_code").send_keys(u"发斯蒂芬")
driver.find_element_by_id("codeSave").click()
driver.find_element_by_id("organization_code").clear()
driver.find_element_by_id("organization_code").send_keys(u"分手多久发货时间的发货就是")
driver.find_element_by_id("codeSave").click()
driver.find_element_by_id("organization_code").clear()
driver.find_element_by_id("organization_code").send_keys(u"防守打法防守打法地方所得税法发送到发")
driver.find_element_by_id("codeSave").click()
driver.find_element_by_link_text(u"修改").click()
那个问题等下试下,现在又遇到个问题 这个一直报错,绝对路径定位也定位不到元素,搞了半天了 页面太多设置和修改
|
|