import time
from selenium import webdriver
import unittest
class testCase2(unittest.TestCase):
def setUp(self):
self.driver=webdriver.Firefox()
self.url="http://localhost:63343/web%E8%81%8A%E5%A4%A9%E5%AE%A4/chatroom/src/main/webapp/views/message.html?_ijt=odvmthjc7gptoi3pqh8biv5e1n&_ij_reload"
self.driver.get(self.url)
self.driver.maximize_window()
time.sleep(3)
def tearDown(self):
self.driver.quit()
#消息界面的自动化测试
def message1(self):
driver = self.driver
url = self.url
driver.get(url)
driver.find_element_by_xpath('//*[@id="dialog-content"]').send_keys("hello,大家好,我是新来群员,我是小徐。")
driver.find_element_by_xpath("/html/body/div/div[2]/div[2]/div[2]/button").click()
time.sleep(3)
#切换频道
driver.find_element_by_xpath("/html/body/div/div[2]/div[1]/div[2]").click()
driver.find_element_by_xpath('//*[@id="dialog-content"]').send_keys("hello,大家好,我是新来群员,我是小徐。")
driver.find_element_by_xpath("/html/body/div/div[2]/div[2]/div[2]/button").click()
time.sleep(3)
#注销
def Logout(self):
driver = self.driver
url = self.url
driver.get(url)
driver.find_element_by_xpath("/html/body/div/div[1]/a").click()
time.sleep(3)
if __name__ == "__main__":
unittest.main()
没有合适的资源?快使用搜索试试~ 我知道了~
web聊天室项目自动化测试脚本
共8个文件
py:5个
pyc:2个
log:1个
需积分: 9 1 下载量 76 浏览量
2022-08-06
20:14:30
上传
评论
收藏 6KB ZIP 举报
温馨提示
项目自动化测试脚本
资源详情
资源评论
资源推荐
收起资源包目录
自动化测试的脚本.zip (8个子文件)
demo2
testWebchat2.py 1KB
runall.py 815B
testWebchat1.py 1KB
__pycache__
testWebchat2.cpython-38.pyc 2KB
testWebchat1.cpython-38.pyc 2KB
geckodriver.log 4KB
testWebchat3.py 1KB
__init__.py 0B
共 8 条
- 1
想进大厂吗
- 粉丝: 7
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0