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_89(self):
driver = self.driver
driver.get(self.base_url + "/")
driver.find_element_by_id("email").send_keys("15889369825@163.com")
driver.find_element_by_id("password").send_keys("123456")
driver.find_element_by_id("check").send_keys("1111")
driver.find_element_by_id("submit").click()
driver.find_element_by_link_text(u"产品服务").click()
driver.find_element_by_link_text(u"型号设置").click()
driver.find_element_by_id("addUser").click()
time.sleep(2)
driver.find_element_by_id("product_type").click()
driver.find_element_by_link_text(u"申请").click()
driver.find_element_by_id("entryTypeName").send_keys(u"付额外夫妇对方会儿防护回复回复而文化符号符合符合无法负责无回复33u3u2heu32e23e 3额饿3 3额の2额3额3饿のの の2额 额3饿3 饿饿3 额32饿")
driver.find_element_by_css_selector("span.label").click()
driver.find_element_by_css_selector("li.last").click()
driver.find_element_by_id("explain").clear()
driver.find_element_by_id("explain").send_keys(u"2の2 额3额3额23饿3 饿")
driver.find_element_by_css_selector("#modelAddModel2 > div.modal-dialog.modal-type-1 > div.modal-body > form.form-horizontal > div.form-group.button-group > button.btn.btn-blue").click()
driver.find_element_by_id(u"addUser").click()
driver.find_element_by_css_selector("#modelAddModel > div.modal-dialog.modal-type-1 > div.modal-content > div.modal-header > button.close").click()
time.sleep(2)
driver.find_element_by_link_text(u"新增").click()
driver.find_element_by_id("product_type").click()
time.sleep(2)
driver.find_element_by_link_text("//span[@value='8']").click()
driver.find_element_by_xpath("(//button[@type='button'])[13]").click()
driver.find_element_by_id("product_type").click()
driver.find_element_by_xpath("//div[@id='modelAddModel']/div/div/div[2]/form/div/div[2]").click()
driver.find_element_by_id("model_name").clear()
driver.find_element_by_id("model_name").send_keys(u"手机产品")
driver.find_element_by_xpath("(//button[@type='button'])[13]").click()
driver.find_element_by_id("product_name").clear()
driver.find_element_by_id("product_name").send_keys(u"手机")
driver.find_element_by_xpath("(//button[@type='button'])[13]").click()
driver.find_element_by_css_selector("div.radio.second > label.radio-label").click()
driver.find_element_by_css_selector("div.radio.second > label.radio-label > input[name=\"radio\"]").click()
driver.find_element_by_xpath("(//button[@type='button'])[13]").click()
driver.find_element_by_xpath("(//button[@type='button'])[13]").click()
driver.find_element_by_xpath("(//button[@type='button'])[12]").click()
怎么反复定位driver.find_element_by_id(u"addUser").click()
|
|