在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/Python  網(wǎng)絡(luò)安全/ selenium python login test with valid,

selenium python login test with valid, invalid test data?

how can implement the following case in python ?

i just cant figure out how to solve this problem
圖片描述

CASE – 1 [ Enter Correct user Name and Password ]

CASE – 2 [ Both Email and Password Fields are blank.]

CASE – 3 [ Email field is filled and Password field is blank. ]

CASE – 4 [ Email field is blank and Password field is filled ]

CASE – 5 [ Email and Password are entered wrong ]

CASE – 6 [ Email is wrong and Password is correct ]

CASE – 7 [ Email is correct and Password is wrong ]

回答
編輯回答
拽很帥
import unittest
from selenium import webdriver

class TestLogin(unittest.TestCase):
    def setUp(self):
        self.driver = webdriver.Chrome()
        self.url = 'http://xxx'
    
    def test_case_1():
        """Test Correct user Name and Password"""
        # code for login
        # assert page title
        pass
        
    def test_case_2():
        """Test Email and Password Fields are blank"""
        pass
        
        ...
        
    def tearDown(self):
        self.driver.quit()  

if __name__ == "__main__":
    unittest.main()
2017年5月26日 13:22