Python 在django开发服务器上打开页面时出现错误的状态行异常
为了更好地报告测试结果,我正在通过长鼻执行selenium测试用例。我编写了以下测试用例Python 在django开发服务器上打开页面时出现错误的状态行异常,python,django,testing,selenium,Python,Django,Testing,Selenium,为了更好地报告测试结果,我正在通过长鼻执行selenium测试用例。我编写了以下测试用例 from selenium import webdriver from selenium.webdriver.common.keys import Keys from proboscis import test import unittest driver = webdriver.Firefox() @test(groups=["unit","login"]) class UI_test(unittes
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from proboscis import test
import unittest
driver = webdriver.Firefox()
@test(groups=["unit","login"])
class UI_test(unittest.TestCase):
def test_SuccessfulErrorMsgOnEmptyUserName(self):
driver.get("http://127.0.0.1:7999/login/")
username_input = driver.find_element_by_id("id_email")
username_input.send_keys('')
password_input = driver.find_element_by_id("id_password")
password_input.send_keys('bill3')
driver.find_element_by_xpath('//input[@value = "Log In"]').click()
driver.implicitly_wait(3)
driver.find_element_by_class_name("error-login")
driver.close()
def run_tests():
from proboscis import TestProgram
# from tests import unit
# Run Proboscis and exit.
TestProgram().run_and_exit()
if __name__ == '__main__':
run_tests()
是什么导致了此代码中的BadStatusLine
异常?看起来像的副本,但我无法标记,因为此问题有悬赏。根据,异常可能是由空响应引起的,因为根本没有状态行
根据,服务器正式告诉客户端没有更多数据,而不是简单地导致连接重置或粗暴超时。请发布完整的回溯好的问题,不一定要在浏览器上执行同样的操作。回答正确一定有问题。为什么示例中的端口是7999?请再次发布回溯