国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

擁抱自動(dòng)化測(cè)試,快速升職加薪丄Selenium+Pytest自動(dòng)化測(cè)試框架教你如何做到

這篇具有很好參考價(jià)值的文章主要介紹了擁抱自動(dòng)化測(cè)試,快速升職加薪丄Selenium+Pytest自動(dòng)化測(cè)試框架教你如何做到。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

目錄:導(dǎo)讀

引言

Selenium+Pytest自動(dòng)化測(cè)試框架是目前最流行的自動(dòng)化測(cè)試工具之一,其強(qiáng)大的功能和易用性援助許多開發(fā)人員和測(cè)試人員。

selenium自動(dòng)化+ pytest測(cè)試框架禪道實(shí)戰(zhàn)

選用的測(cè)試網(wǎng)址為我電腦本地搭建的禪道

conftest.py更改

config.ini更改

conf.py更改

page更改

page_element更改

page_object更改

TestCase更改

測(cè)試結(jié)果

寫在最后


引言

Selenium+Pytest自動(dòng)化測(cè)試框架是目前最流行的自動(dòng)化測(cè)試工具之一,其強(qiáng)大的功能和易用性援助許多開發(fā)人員和測(cè)試人員。

當(dāng)前最新消息顯示,隨著人們對(duì)軟件質(zhì)量的要求不斷提高,自動(dòng)化測(cè)試工作正在變得越來越重要。這也導(dǎo)致越來越多的公司和組織開始招聘具有自動(dòng)化測(cè)試技能的人才,并愿意為其提供更高的薪酬和晉升機(jī)會(huì)。

在這種情況下,學(xué)習(xí)并掌握Selenium+Pytest自動(dòng)化測(cè)試框架將成為一個(gè)非常有價(jià)值的能力,并且有望幫助你在職場(chǎng)上實(shí)現(xiàn)快速升職加薪的目標(biāo)。

因此,如果你想迅速提高自己的技能并進(jìn)一步發(fā)展職業(yè)生涯,請(qǐng)跟隨我們的指引,學(xué)習(xí)Selenium+Pytest自動(dòng)化測(cè)試框架,并使用它來實(shí)現(xiàn)高效的自動(dòng)化測(cè)試工作!

前段時(shí)間有人問我登錄攜帶登錄的測(cè)試框架該怎么處理,今天就對(duì)框架做一點(diǎn)小升級(jí)吧,加入登錄的測(cè)試功能。

selenium自動(dòng)化+ pytest測(cè)試框架禪道實(shí)戰(zhàn)

選用的測(cè)試網(wǎng)址為我電腦本地搭建的禪道

更改了以下的一些文件,框架為原文章框架主體

conftest.py更改

conftest.py

#!/usr/bin/env python3
# -*- coding:utf-8 -*-
import base64
import pytest
import allure
from py.xml import html
from selenium import webdriver
from page.webpage import WebPage
from common.readconfig import ini
from tools.send_mail import send_report
from tools.times import timestamp
from config.conf import cm

driver = None


@pytest.fixture(scope='session', autouse=True)
def drivers(request):
    global driver
    if driver is None:
        driver = webdriver.Chrome()
        web = WebPage(driver)
        web.get_url(ini.url)

    def fn():
        driver.quit()

    request.addfinalizer(fn)
    return driver


@pytest.hookimpl(hookwrapper=True)
def pytest_runtest_makereport(item):
    """
    當(dāng)測(cè)試失敗的時(shí)候,自動(dòng)截圖,展示到html報(bào)告中
    :param item:
    """
    pytest_html = item.config.pluginmanager.getplugin('html')
    outcome = yield
    report = outcome.get_result()
    extra = getattr(report, 'extra', [])

    if report.when == 'call' or report.when == "setup":
        xfail = hasattr(report, 'wasxfail')
        if (report.skipped and xfail) or (report.failed and not xfail):
            screen_img = _capture_screenshot()
            if screen_img:
                html = '<div><img src="data:image/png;base64,%s" alt="screenshot" style="width:1024px;height:768px;" ' \
                       'onclick="window.open(this.src)" align="right"/></div>' % screen_img
                extra.append(pytest_html.extras.html(html))
        report.extra = extra
        report.description = str(item.function.__doc__)


def pytest_html_results_table_header(cells):
    cells.insert(1, html.th('用例名稱'))
    cells.insert(2, html.th('Test_nodeid'))
    cells.pop(2)


def pytest_html_results_table_row(report, cells):
    cells.insert(1, html.td(report.description))
    cells.insert(2, html.td(report.nodeid))
    cells.pop(2)


def pytest_html_results_table_html(report, data):
    if report.passed:
        del data[:]
        data.append(html.div('通過的用例未捕獲日志輸出.', class_='empty log'))


def pytest_html_report_title(report):
    report.title = "pytest示例項(xiàng)目測(cè)試報(bào)告"


def pytest_configure(config):
    config._metadata.clear()
    config._metadata['測(cè)試項(xiàng)目'] = "測(cè)試百度官網(wǎng)搜索"
    config._metadata['測(cè)試地址'] = ini.url


def pytest_html_results_summary(prefix, summary, postfix):
    # prefix.clear() # 清空summary中的內(nèi)容
    prefix.extend([html.p("所屬部門: XX公司測(cè)試部")])
    prefix.extend([html.p("測(cè)試執(zhí)行人: 隨風(fēng)揮手")])


def pytest_terminal_summary(terminalreporter, exitstatus, config):
    """收集測(cè)試結(jié)果"""
    result = {
        "total": terminalreporter._numcollected,
        'passed': len(terminalreporter.stats.get('passed', [])),
        'failed': len(terminalreporter.stats.get('failed', [])),
        'error': len(terminalreporter.stats.get('error', [])),
        'skipped': len(terminalreporter.stats.get('skipped', [])),
        # terminalreporter._sessionstarttime 會(huì)話開始時(shí)間
        'total times': timestamp() - terminalreporter._sessionstarttime
    }
    print(result)
    if result['failed'] or result['error']:
        send_report()


def _capture_screenshot():
    """截圖保存為base64"""
    now_time, screen_path = cm.screen_file
    driver.save_screenshot(screen_path)
    allure.attach.file(screen_path, "測(cè)試失敗截圖...{}".format(
        now_time), allure.attachment_type.PNG)
    with open(screen_path, 'rb') as f:
        imagebase64 = base64.b64encode(f.read())
    return imagebase64.decode()

config.ini更改

[HOST]
HOST = http://127.0.0.1/zentao/user-login-L3plbnRhby9teS5odG1s.html

conf.py更改

#!/usr/bin/env python3
# -*- coding:utf-8 -*-
import os
from selenium.webdriver.common.by import By
from tools.times import datetime_strftime


class ConfigManager(object):
    # 項(xiàng)目目錄
    BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

    # 日志目錄
    LOG_PATH = os.path.join(BASE_DIR, 'logs')

    # 報(bào)告目錄
    REPORT_PATH = os.path.join(BASE_DIR, 'report', 'report.html')

    ELEMENT_PATH = os.path.join(BASE_DIR, 'page_element')

    # 元素定位的類型
    LOCATE_MODE = {
        'css': By.CSS_SELECTOR,
        'xpath': By.XPATH,
        'name': By.NAME,
        'id': By.ID,
        'class': By.CLASS_NAME
    }

    # 郵件信息
    EMAIL_INFO = {
        'username': '1084502012@qq.com',  # 切換成你自己的地址
        'password': 'QQ郵箱授權(quán)碼',
        'smtp_host': 'smtp.qq.com',
        'smtp_port': 465
    }

    # 收件人
    ADDRESSEE = [
        '1084502012@qq.com',
    ]

    @property
    def ini_file(self):
        # 配置文件
        _file = os.path.join(self.BASE_DIR, 'config', 'config.ini')
        if not os.path.exists(_file):
            raise FileNotFoundError("配置文件%s不存在!" % _file)
        return _file

    def element_file(self, name):
        """頁面元素文件"""
        element_path = os.path.join(self.ELEMENT_PATH, '%s.yaml' % name)
        if not os.path.exists(element_path):
            raise FileNotFoundError("%s 文件不存在!" % element_path)
        return element_path

    @property
    def log_path(self):
        log_path = os.path.join(self.BASE_DIR, 'logs')
        if not os.path.exists(log_path):
            os.makedirs(log_path)
        return os.path.join(log_path, "%s.log" % datetime_strftime())

    @property
    def screen_file(self):
        now_time = datetime_strftime("%Y%m%d%H%M%S")
        # 截圖目錄
        screenshot_dir = os.path.join(self.BASE_DIR, 'screen_capture')
        if not os.path.exists(screenshot_dir):
            os.makedirs(screenshot_dir)
        screen_path = os.path.join(screenshot_dir, "{}.png".format(now_time))
        return now_time, screen_path


cm = ConfigManager()
if __name__ == '__main__':
    print(cm.BASE_DIR)

page更改

webpage.py

添加了幾個(gè)函數(shù)!

#!/usr/bin/env python3
# -*- coding:utf-8 -*-
"""
selenium基類
本文件存放了selenium基類的封裝方法
"""
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from selenium.common.exceptions import TimeoutException, NoSuchElementException
from config.conf import cm
from tools.times import sleep
from tools.logger import Logger

log = Logger(__name__).logger


class WebPage(object):
    """selenium基類"""

    def __init__(self, driver):
        # self.driver = webdriver.Chrome()
        self.driver = driver
        self.timeout = 20
        self.wait = WebDriverWait(self.driver, self.timeout)

    def get_url(self, url):
        """打開網(wǎng)址并驗(yàn)證"""
        self.driver.maximize_window()
        self.driver.set_page_load_timeout(60)
        try:
            self.driver.get(url)
            self.driver.implicitly_wait(10)
            log.info("打開網(wǎng)頁:%s" % url)
        except TimeoutException:
            raise TimeoutException("打開%s超時(shí)請(qǐng)檢查網(wǎng)絡(luò)或網(wǎng)址服務(wù)器" % url)

    @staticmethod
    def element_locator(func, locator):
        """元素定位器"""
        name, value = locator
        return func(cm.LOCATE_MODE[name], value)

    def find_element(self, locator):
        """尋找單個(gè)元素"""
        return WebPage.element_locator(lambda *args: self.wait.until(
            EC.presence_of_element_located(args)), locator)

    def find_elements(self, locator):
        """查找多個(gè)相同的元素"""
        return WebPage.element_locator(lambda *args: self.wait.until(
            EC.presence_of_all_elements_located(args)), locator)

    def focus(self):
        """聚焦元素"""
        self.driver.execute_script("window.scrollTo(0,document.body.scrollHeight)")

    def elements_num(self, locator):
        """獲取相同元素的個(gè)數(shù)"""
        number = len(self.find_elements(locator))
        log.info("相同元素:{}".format((locator, number)))
        return number

    def input_text(self, locator, txt):
        """輸入(輸入前先清空)"""
        sleep(0.5)
        ele = self.find_element(locator)
        ele.clear()
        ele.send_keys(txt)
        log.info("輸入文本:{}".format(txt))

    def is_click(self, locator):
        """點(diǎn)擊"""
        ele = self.find_element(locator)
        ele.click()
        sleep()
        log.info("點(diǎn)擊元素:{}".format(locator))

    def is_exists(self, locator):
        """元素是否存在(DOM)"""
        try:
            WebPage.element_locator(lambda *args: EC.presence_of_element_located(args)(self.driver), locator)
            return True
        except NoSuchElementException:
            return False

    def alert_exists(self):
        """判斷彈框是否出現(xiàn),并返回彈框的文字"""
        alert = EC.alert_is_present()(self.driver)
        if alert:
            text = alert.text
            log.info("Alert彈窗提示為:%s" % text)
            alert.accept()
            return text
        else:
            log.error("沒有Alert彈窗提示!")

    def element_text(self, locator):
        """獲取當(dāng)前的text"""
        _text = self.find_element(locator).text
        log.info("獲取文本:{}".format(_text))
        return _text

    def get_attribute(self, locator, name):
        """獲取元素屬性"""
        return self.find_element(locator).get_attribute(name)

    @property
    def get_source(self):
        """獲取頁面源代碼"""
        return self.driver.page_source

    def refresh(self):
        """刷新頁面F5"""
        self.driver.refresh()
        self.driver.implicitly_wait(30)


if __name__ == "__main__":
    pass

page_element更改

login.yaml

賬號(hào): "css==input[name=account]"
密碼: "css==input[name=password]"
登錄: "css==button#submit"
我的地盤: "xpath==//nav[@id='navbar']//span[text()=' 我的地盤']"
右上角名稱: "css==.user-name"
退出登錄: "xpath==//a[text()='退出']"

product.yaml

產(chǎn)品按鈕: "xpath==//nav[@id='navbar']//a[text()='產(chǎn)品']"
添加產(chǎn)品: "xpath==//div[@id='pageActions']//a[text()=' 添加產(chǎn)品']"
產(chǎn)品名稱: "css==#name"
產(chǎn)品代號(hào): "css==#code"
保存產(chǎn)品: "css==#submit"
產(chǎn)品列表: "xpath==//ul[@class='nav nav-stacked nav-secondary scrollbar-hover']//a[1]"

page_object更改

loginpage.py

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from page.webpage import WebPage
from common.readelement import Element

login = Element('login')


class LoginPage(WebPage):
    """登錄類"""

    def username(self, name):
        """用戶名"""
        self.input_text(login['賬號(hào)'], name)

    def password(self, pwd):
        """密碼"""
        self.input_text(login['密碼'], pwd)

    def submit(self):
        """登錄"""
        self.is_click(login['登錄'])

    def quit_login(self):
        """退出登錄"""
        self.is_click(login['右上角名稱'])
        self.is_click(login['退出登錄'])

    def login_success(self):
        """驗(yàn)證登錄"""
        return self.is_exists(login['我的地盤'])

productpage.py

#!/usr/bin/env python3
# -*- coding:utf-8 -*-
from page.webpage import WebPage, sleep
from common.readelement import Element

product = Element('product')


class ProductPage(WebPage):
    """產(chǎn)品類"""

    def click_product(self):
        """點(diǎn)擊產(chǎn)品"""
        self.is_click(product['產(chǎn)品按鈕'])

    def add_product(self):
        """添加產(chǎn)品"""
        self.is_click(product['添加產(chǎn)品'])

    def add_product_content(self, name, code):
        """添加產(chǎn)品內(nèi)容"""
        self.input_text(product['產(chǎn)品名稱'], name)
        self.input_text(product['產(chǎn)品代號(hào)'], code)

    def save_product(self):
        """保存產(chǎn)品"""
        self.focus()
        self.is_click(product['保存產(chǎn)品'])

    def product_list(self):
        """產(chǎn)品列表"""
        return [i.get_attribute('title') for i in self.find_elements(product['產(chǎn)品列表'])]


if __name__ == '__main__':
    a = product['產(chǎn)品列表'][1] + "[1]"
    print(a)

TestCase更改

test_login.py

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import pytest
from tools.times import sleep
from page_object.loginpage import LoginPage


class TestLogin:
    """測(cè)試登錄"""

    @pytest.mark.parametrize("name,pwd", [('admin', 'Admin123456'), ('test', 'test123')])
    def test_001(self, drivers, name, pwd):
        login = LoginPage(drivers)
        login.username(name)
        login.password(pwd)
        login.submit()
        sleep(3)
        res = login.alert_exists()
        if res:
            assert res == "登錄失敗,請(qǐng)檢查您的用戶名或密碼是否填寫正確。"
        elif login.login_success():
            login.quit_login()

test_product.py

#!/usr/bin/env python3
# -*- coding:utf-8 -*-
import pytest
import allure
from random import randint
from tools.times import sleep
from page_object.loginpage import LoginPage
from page_object.productpage import ProductPage


@allure.feature("測(cè)試產(chǎn)品模塊")
class TestProduct:

    @pytest.fixture(scope='class', autouse=True)
    def is_login(self, request, drivers):
        login = LoginPage(drivers)
        login.username('admin')
        login.password('Admin123456')
        login.submit()
        sleep(3)

        def logout():
            login.quit_login()

        request.addfinalizer(logout)

    @allure.story("測(cè)試添加產(chǎn)品")
    def test_001(self, drivers):
        """搜索"""
        product = ProductPage(drivers)
        product.click_product()
        product.add_product()
        name, code = randint(100, 999), randint(100, 999)
        product.add_product_content(name, code)
        product.save_product()
        sleep(3)
        product.click_product()
        assert str(name) in product.product_list()


if __name__ == '__main__':
    pytest.main(['TestCase/test_aproduct.py'])

測(cè)試結(jié)果

登錄之后的測(cè)試用例:

擁抱自動(dòng)化測(cè)試,快速升職加薪丄Selenium+Pytest自動(dòng)化測(cè)試框架教你如何做到

測(cè)試登錄的用例

擁抱自動(dòng)化測(cè)試,快速升職加薪丄Selenium+Pytest自動(dòng)化測(cè)試框架教你如何做到

寫在最后

這篇貼子到這里就結(jié)束了,最后,希望看這篇帖子的朋友能夠有所收獲。

都到這了記得三連支持一下吧。文章來源地址http://www.zghlxwxcb.cn/news/detail-424138.html

到了這里,關(guān)于擁抱自動(dòng)化測(cè)試,快速升職加薪丄Selenium+Pytest自動(dòng)化測(cè)試框架教你如何做到的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • selenium 自動(dòng)化測(cè)試—如何搭建自動(dòng)化測(cè)試環(huán)境?

    selenium 自動(dòng)化測(cè)試—如何搭建自動(dòng)化測(cè)試環(huán)境?

    ?? 視頻學(xué)習(xí): 文末有免費(fèi)的配套視頻可觀看 ?? 點(diǎn)擊文末小卡片 ,免費(fèi)獲取軟件測(cè)試全套資料,資料在手,漲薪更快 最近也有很多人私下問我,selenium學(xué)習(xí)難嗎,基礎(chǔ)入門的學(xué)習(xí)內(nèi)容很多是3以前的版本資料,對(duì)于有基礎(chǔ)的人來說,3到4的差別雖然有,但是不足以影響自己,

    2024年02月19日
    瀏覽(33)
  • 【自動(dòng)化測(cè)試】Java+Selenium自動(dòng)化測(cè)試環(huán)境搭建

    【自動(dòng)化測(cè)試】Java+Selenium自動(dòng)化測(cè)試環(huán)境搭建

    本主要介紹以Java為基礎(chǔ),搭建Selenium自動(dòng)化測(cè)試環(huán)境,并且實(shí)現(xiàn)代碼編寫的過程。 1.Selenium介紹 Selenium 1.0 包含 core、IDE、RC、grid 四部分,selenium 2.0 則是在兩位大牛偶遇相互溝通決定把面向?qū)ο蠼Y(jié)構(gòu)化(OOPP)和便于編寫代碼的各自思想予以整合后形成的新工具,也就是我們所

    2024年02月11日
    瀏覽(21)
  • JavaScript+Selenium自動(dòng)化測(cè)試_selenium和js能一起做自動(dòng)化測(cè)試

    JavaScript+Selenium自動(dòng)化測(cè)試_selenium和js能一起做自動(dòng)化測(cè)試

    var webdriver = require(‘selenium-webdriver’), By = webdriver.By, until = webdriver.until; var driver = new webdriver.Builder() .forBrowser(‘chrome’) .build(); driver.get(‘https://www.baidu.com’); driver.findElement(By.id(‘kw’)).sendKeys(‘webdriver’); driver.findElement(By.id(‘su’)).click(); driver.wait(until.titleIs(‘webdriver_百度

    2024年04月25日
    瀏覽(25)
  • 自動(dòng)化測(cè)試介紹、selenium用法(自動(dòng)化測(cè)試框架+爬蟲可用)

    自動(dòng)化測(cè)試介紹、selenium用法(自動(dòng)化測(cè)試框架+爬蟲可用)

    1、什么是自動(dòng)化測(cè)試? 程序測(cè)試程序、代碼代替思維、腳本代替人工 核心:質(zhì)量和效率 作用:降低成本、節(jié)省人力時(shí)間、推動(dòng)CI和DevOps、準(zhǔn)確性和可靠性、模擬人工難以實(shí)現(xiàn)的手段、快速持續(xù)迭代發(fā)布能力、衡量產(chǎn)品的質(zhì)量、提升測(cè)試效率、提高測(cè)試覆蓋率 2、手工測(cè)試

    2024年03月08日
    瀏覽(39)
  • 自動(dòng)化測(cè)試之web自動(dòng)化(Selenium)

    自動(dòng)化測(cè)試之web自動(dòng)化(Selenium)

    ??? 交流討論: 歡迎加入我們一起學(xué)習(xí)! ?? 資源分享 : 耗時(shí)200+小時(shí)精選的「軟件測(cè)試」資料包 ??? 教程推薦: 火遍全網(wǎng)的《軟件測(cè)試》教程?? ?? 歡迎點(diǎn)贊 ?? 收藏 ?留言 ?? 如有錯(cuò)誤敬請(qǐng)指正! yycnblog 自動(dòng)化測(cè)試概念:讓程序代替人為去驗(yàn)證程序功能的過程,本

    2024年03月15日
    瀏覽(46)
  • 測(cè)開 - 自動(dòng)化測(cè)試 selenium - 自動(dòng)化概念 && 測(cè)試環(huán)境配置 - 細(xì)節(jié)狂魔

    測(cè)開 - 自動(dòng)化測(cè)試 selenium - 自動(dòng)化概念 && 測(cè)試環(huán)境配置 - 細(xì)節(jié)狂魔

    自動(dòng)化測(cè)試指 軟件測(cè)試的自動(dòng)化 ,在 預(yù)設(shè)狀態(tài)下 運(yùn)行應(yīng)用程序或者系統(tǒng). 預(yù)設(shè)條件 包括正常和異常 ,最后評(píng)估運(yùn)行結(jié)果。 ? 自動(dòng)化測(cè)試,就是 將人為驅(qū)動(dòng)的測(cè)試行為轉(zhuǎn)化為機(jī)器執(zhí)行的過程。 【機(jī)器 代替 人工】 自動(dòng)化測(cè)試 包括UI自動(dòng)化,接口自動(dòng)化,單元測(cè)試自動(dòng)化。

    2024年02月02日
    瀏覽(36)
  • Selenium+python怎么搭建自動(dòng)化測(cè)試框架、執(zhí)行自動(dòng)化測(cè)試用例、生成自動(dòng)化測(cè)試報(bào)告、發(fā)送測(cè)試報(bào)告郵件

    Selenium+python怎么搭建自動(dòng)化測(cè)試框架、執(zhí)行自動(dòng)化測(cè)試用例、生成自動(dòng)化測(cè)試報(bào)告、發(fā)送測(cè)試報(bào)告郵件

    本人在網(wǎng)上查找了很多做自動(dòng)化的教程和實(shí)例,偶然的一個(gè)機(jī)會(huì)接觸到了selenium,覺得非常好用。后來就在網(wǎng)上查閱各種selenium的教程,但是網(wǎng)上的東西真的是太多了,以至于很多東西參考完后無法系統(tǒng)的學(xué)習(xí)和應(yīng)用。 以下整理的只是書中自動(dòng)化項(xiàng)目的知識(shí)內(nèi)容,介紹怎么搭

    2024年02月05日
    瀏覽(30)
  • 【軟件測(cè)試/自動(dòng)化測(cè)試】WebDriver+Selenium實(shí)現(xiàn)瀏覽器自動(dòng)化

    【軟件測(cè)試/自動(dòng)化測(cè)試】WebDriver+Selenium實(shí)現(xiàn)瀏覽器自動(dòng)化

    前言 使用場(chǎng)景 原理 環(huán)境準(zhǔn)備 ?開發(fā) First Script WebDriver API 瀏覽器 元素 總結(jié) Selenium是一款可以自動(dòng)化操作瀏覽器的開源項(xiàng)目,最初的目的是瀏覽器功能的自動(dòng)化測(cè)試,但是隨著項(xiàng)目的發(fā)展,人們根據(jù)它的特性也用來做一些更多的有意思的功能而不僅僅是UI的自動(dòng)化測(cè)試工具。

    2024年02月08日
    瀏覽(64)
  • 自動(dòng)化測(cè)試:5分鐘了解Selenium以及如何提升自動(dòng)化測(cè)試的效果

    自動(dòng)化測(cè)試:5分鐘了解Selenium以及如何提升自動(dòng)化測(cè)試的效果

    在快節(jié)奏的技術(shù)世界里,自動(dòng)化測(cè)試已經(jīng)成為確保?Web?應(yīng)用程序質(zhì)量和性能的重要手段。自動(dòng)化測(cè)試不僅加快了測(cè)試過程,還提高了測(cè)試的重復(fù)性和準(zhǔn)確性。Selenium,作為領(lǐng)先的自動(dòng)化測(cè)試工具之一,為測(cè)試人員提供了強(qiáng)大的功能來模擬用戶在?Web?瀏覽器中的行為。在本文中

    2024年01月20日
    瀏覽(29)
  • 自動(dòng)化測(cè)試selenium

    自動(dòng)化測(cè)試selenium

    將人工的測(cè)試手段進(jìn)行轉(zhuǎn)換,讓代碼去執(zhí)行。 自動(dòng)化分類: 單元測(cè)試 接口測(cè)試 UI自動(dòng)化測(cè)試 selenium 是什么 selenium 是web應(yīng)用中基于UI的自動(dòng)化測(cè)試框架。 selenium 特點(diǎn) 支持多平臺(tái)、多瀏覽器、多語言、有豐富的API 工作原理 定位元素 定位元素: findElement 通過CSS 選擇器查找定

    2024年02月07日
    瀏覽(27)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包