导入GetConfig 来自Libs.Common导入记录 进口口 进口单位测试 来自selenium import webdriver 来自selenium.webdriver.common.keys导入密钥 来自HtmlTestRunner导入HTMLTestRunner 导入HtmlTestRunner 来自selenium.common.exceptions import NoSuchElementException 来自selenium.webdriver.common.by导入
class Dummy(GetConfig):
def __init__(self, namespace=__name__, level="info"):
super(Dummy, self).__init__(namespace, level)
self._level = level
self._namespace = namespace
self._log = Logging.GetLogger(namespace, self._level)
def test_ail_login(self):
driver=self.driver
driver=webdriver.firefox()
driver.get("www.ultimatix.net")
self.username1=self.driver.find_element_by_id("USER")
self.username1.clear()
self.password1=self.driver.find_element_by_id("PASSWORD")
self.password1.clear()
#title1=self.driver.title()
#self.assertIn("Ultimatix - Digitally Connected !", driver.title,"both the names of titles are not identicle")
self.assertTrue(driver.title=="Ultimatix - Digitally Connected !" ,"both titles are not same")
assert "No results found." not in driver.page_source
self.username1.send_keys("asdfasdfasdfasdf")
self.password1.send_keys("asdfasdfasdf")
driver.find_element_by_id("login_button").click()
driver.close()
错误是:at
答案 0 :(得分:0)
from Libs.Core.GetConfig import GetConfig
from Libs.Common import Logging
import os
import unittest
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from HtmlTestRunner import HTMLTestRunner
import HtmlTestRunner
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.by import By
class Dummy(GetConfig):
def __init__(self, namespace=__name__, level="info"):
super(Dummy, self).__init__(namespace, level)
self._level = level
self._namespace = namespace
self._log = Logging.GetLogger(namespace, self._level)
def test_tcsmail_login(self):
driver=self.driver
driver=webdriver.firefox()
driver.get("www.ultimatix.net")
self.username1=self.driver.find_element_by_id("USER")
self.username1.clear()
self.password1=self.driver.find_element_by_id("PASSWORD")
self.password1.clear()
#title1=self.driver.title()
#self.assertIn("Ultimatix - Digitally Connected !", driver.title,"both the names of titles are not identicle")
self.assertTrue(driver.title=="Ultimatix - Digitally Connected !" ,"both titles are not same")
assert "No results found." not in driver.page_source
self.username1.send_keys("dfds")
self.password1.send_keys("afdssd")
driver.find_element_by_id("login_button").click()
driver.close()