我最近发现了谷歌浏览器的 SeleniumIDE 扩展,但是有一些我不明白的...
from selenium import webdriver
from selenium.webdriver.common.by import By
class TestStealth():
def setup_method(self, method):
print("setup_method")
self.driver = webdriver.Chrome()
self.vars = {}
def teardown_method(self, method):
self.driver.quit()
def test_stealth(self):
print("Testing")
self.driver.get("https://stealthxio.myshopify.com/products/stealthxio-practice")
self.driver.set_window_size(968, 1039)
这是我从 selenium 获得的代码,当我尝试运行时:
run = TestStealth()
run.setup_method()
run.test_stealth()
我在 run.setup_method() 中收到错误:
Missing 1 required positional argument: 'method'
有谁知道我做错了什么?