当前位置:网站首页>Actual combat - store login test
Actual combat - store login test
2022-06-21 17:03:00 【Expert of explosive liver fist】
import time
import pytest
# Import selenium Of webdriver
from selenium import webdriver
class Testlogin:
# Before the test ( Open the browser , Enter login URL )
def setup_class(self):
# Open Google browser
self.driver=webdriver.Chrome()
# Get the website address you need to visit
self.driver.get('http://39.98.138.157/shopxo/index.php?s=/index/user/logininfo.html')
# The user login --- Login successful
def test_01(self):
# Get the name of the account input box accounts, And fill in the account number qiushui
self.driver.find_element_by_name('accounts').send_keys('qiushui')
# Get the name of the password input box pwd, And fill in the password 123456
self.driver.find_element_by_name('pwd').send_keys('123456')
# Get the login button xpath Address
self.driver.find_element_by_xpath('/html/body/div[4]/div/div[2]/div[2]/form/div[3]/button').click()
# window maximizing
self.driver.maximize_window()
# The user login --- Login failed
def test_02(self):
# Get the name of the account input box accounts, And fill in the wrong account number qiushui2
self.driver.find_element_by_name('accounts').send_keys('qiushui2')
# Get the name of the password input box pwd, And fill in the password 123456
self.driver.find_element_by_name('pwd').send_keys('123456')
# Get the login button xpath Address
self.driver.find_element_by_xpath('/html/body/div[4]/div/div[2]/div[2]/form/div[3]/button').click()
# window maximizing
self.driver.maximize_window()
# After the test ( rest 5 Seconds later , Close the browser )
def teardown_class(self):
time.sleep(5)
self.driver.quit()
# Perform the test
if __name__ == '__main__':
pytest.main(['-vs','test_login.py'])
边栏推荐
- Unittest框架的测试日志
- 云原生监控系统·夜莺近期新功能一览,解决多个生产痛点
- HUAWEI(13)——路由引入
- 如何判断DNS解析故障?如何解决DNS解析错误?
- Come and watch – tpt18 new report
- Unable to boot device in current state: started - unable to boot device in current state: booted
- Huawei (13) - route introduction
- Pytest框架
- Go language development code self test excellent go fuzzing usage explanation
- 海瑞科技完成数千万元Pre-A轮融资,打造国内首个人工智能配电物联网
猜你喜欢

Implementation and landing of any to any real-time voice change RTC dev Meetup

Overseas new things | zoovu, an American AI startup, raised a new round of financing of US $169million to optimize the online "product discovery" experience for consumers

Why do you want to develop tea mall applet app?

Wechat applet development tutorial - Introduction to text components

Huawei (13) - route introduction

微信小程序开发入门介绍-布局组件

The release of autok3s v0.5.0 continues to be simple and friendly

Recruitment order | data visualization development platform "flyfish" and "super experience officer" are recruited!

2022年Q1手机银行用户规模达6.5亿,加强ESG个人金融产品创新

重磅丨国内首份呈现数据库发展历程的图鉴正式发布!
随机推荐
Postman basic operations
Pytest framework implements pre post processing
Cloud native hybrid cloud network interconnection
如何编写测试用例
Qtcreator error reporting solution
Notice on Revising the guidelines for the planning, design and livable construction of housing with common property rights in Beijing (for Trial Implementation)
[live broadcast preview] at 19:00 on June 24, hcsd live broadcast -- employment guide, which will take you through the interview points for the upcoming autumn recruitment and summer internship~~
海瑞科技完成数千万元Pre-A轮融资,打造国内首个人工智能配电物联网
Simulation Implementation of string class
qtcreator报错解决
Unittest框架
【1108. IP 地址無效化】
Pytest framework
PingCAP 入选 2022 Gartner 云数据库“客户之声”,获评“卓越表现者”最高分
微信小程序-image加载图片工具中显示,真机中不显示
Notice on printing and distributing the Interim Measures of Beijing Municipality for the administration of housing with common property rights
Yaml file details
What are the differences between SVN and VSS
How to judge DNS resolution failure? How to resolve DNS resolution errors?
Focusing on industrial intelligence scenarios, Huawei cloud recruits partners to help solve transformation problems