Aprendí la prueba aleatoria ayer. Buscó instantáneamente dispositivos de prueba aleatorios.
Encontré un complemento de Chrome para tontos reales para hacer pruebas aleatorias.
1. Extensión de cromo
Bienvenido a instalar desde el siguiente enlace:
https://chromeload.com/extension-41598-monkey-testing
Después de la instalación, inicie la aplicación, haga clic en el complemento y haga clic en el botón Inicio. Comienzan las pruebas aleatorias.
Luego haga clic en detener para terminar.
2. Playwright puede probar códigos pequeños para cuadros de entrada y botones.
Use Playwright para escribir un programa pequeño y generar programas pequeños al azar.
from playwright.sync_api import Playwright, sync_playwright
def fill_and_submit_form(page):
# Find all input fields on the page
input_fields = page.query_selector_all('input')
# Fill in each input field with a unique value
for i, input_field in enumerate(input_fields):
input_field.fill(f'test{i}')
# Find the submit button and click it
submit_button = page.query_selector('button[type="submit"]')
submit_button.click()
with sync_playwright() as playwright:
# Launch the browser and create a new page
browser = playwright.chromium.launch()
page = browser.new_page()
# Navigate to the target web page
page.goto('https://example.com')
# Fill in and submit the form on the page
fill_and_submit_form(page)
# Close the browser
browser.close()
3. Una herramienta de prueba de Monkey que puede probar todos los componentes de una página web
Utilice el siguiente código para probar componentes aleatorios en todas las páginas.
import random
import time
from playwright.sync_api import Playwright, sync_playwright
def monkey_test_page(page, num_iterations):
# Define a list of action functions to perform on the page
actions = [click_random_element, fill_random_input, navigate_random_link]
for i in range(num_iterations):
# Randomly choose an action function from the list
action = random.choice(actions)
# Perform the chosen action on the page
action(page)
# Wait for a random amount of time between actions
time.sleep(random.uniform(0.5, 1.5))
def click_random_element(page):
# Find all clickable elements on the page
clickable_elements = page.query_selector_all('a, button')
# Randomly choose an element and click it
random_element = random.choice(clickable_elements)
random_element.click()
def fill_random_input(page):
# Find all input fields on the page
input_fields = page.query_selector_all('input[type="text"], input[type="password"], textarea')
# Randomly choose an input field and fill it with a random string
random_input = random.choice(input_fields)
random_input.fill(''.join(random.choices('abcdefghijklmnopqrstuvwxyz', k=10)))
def navigate_random_link(page):
# Find all links on the page
links = page.query_selector_all('a')
# Randomly choose a link and navigate to it
random_link = random.choice(links)
page.goto(random_link.get_attribute('href'))
with sync_playwright() as playwright:
# Launch the browser and create a new page
browser = playwright.chromium.launch()
page = browser.new_page()
# Navigate to the target web page
page.goto('https://example.com')
# Perform monkey testing on the page for 10 iterations
monkey_test_page(page, 10)
# Close the browser
browser.close()
Date prisa y utilízalo para probar tu propia aplicación web.
Finalmente: el tutorial completo de aprendizaje en video de prueba de software a continuación se ha ordenado y cargado, y los amigos pueden obtenerlo gratis si lo necesitan【保证100%免费】
Estos materiales deberían ser el almacén de preparación más amplio y completo para los amigos [de pruebas de software]. Este almacén también ha acompañado a decenas de miles de ingenieros de pruebas a través del viaje más difícil. ¡Espero que también pueda ayudarlo a usted!
软件测试技术交流群社:786229024(里面还有工作内推机会,毕竟我们是关系社会。)
Documentación de la entrevista de prueba de software
Debemos estudiar para encontrar un trabajo bien remunerado. Las siguientes preguntas de la entrevista son los materiales de entrevista más recientes de empresas de Internet de primer nivel como Ali, Tencent y Byte, y algunos jefes de Byte han dado respuestas autorizadas. Termine este conjunto Los materiales de la entrevista creen que todo el mundo puede encontrar un trabajo satisfactorio.