相关疑难解决方法(0)

使用Selenium Python API绑定从Chrome获取console.log输出

我正在使用Selenium通过Python API绑定在Chrome中运行测试,而我无法确定如何配置Chrome以使console.log加载测试的输出可用.我看到WebDriver对象上有get_log()log_types()方法,我看过Get chrome的控制台日志,它显示了如何用Java做事.但我没有LoggingPreferences在Python API中看到相当于Java的类型.有没有办法完成我需要的东西?

python logging selenium google-chrome

55
推荐指数
2
解决办法
5万
查看次数

如何使用selenium.py(python代码)获取状态代码

我正在用python编写一个selenium脚本,但我想我没有看到任何关于的信息:

如何从selenium Python代码获取http状态代码.

或者我错过了什么.如果有人发现,请随时发布.

python selenium

28
推荐指数
4
解决办法
4万
查看次数

通过selenium进行浏览器性能测试

我们protractor用于测试内部AngularJS应用程序.

除了功能测试之外,我们protractor-perf还会检查性能回归,其帮助基于nodejs browser-perf库.因为,"性能是一种功能".

随着protractor-perf我们可以测量并同时使浏览器的行为,主张不同的性能特点,例如:

browser.get('http://www.angularjs.org');

perf.start(); // Start measuring the metrics
element(by.model('todoText')).sendKeys('write a protractor test');
element(by.css('[value="add"]')).click();
perf.stop(); // Stop measuring the metrics 

if (perf.isEnabled) { // Is perf measuring enabled ?
    // Check for perf regressions, just like you check for functional regressions
    expect(perf.getStats('meanFrameTime')).toBeLessThan(60); 
};
Run Code Online (Sandbox Code Playgroud)

现在,对于另一个内部应用程序,我们有一组用Python编写的基于selenium的测试.

是否可以使用selenium-python检查性能回归,还是应该使用protractor能够编写浏览器性能测试来重写测试?

python selenium performance-testing selenium-webdriver protractor

20
推荐指数
2
解决办法
6917
查看次数

获取 TypeError:在将 Appium 与 Selenium 4.10 一起使用时,WebDriver.__init__() 获得了意外的关键字参数“desired_capativity”

错误: HOOK-ERROR in before_scenario: TypeError: WebDriver.__init__() got an unexpected keyword argument 'desired_capabilities'

您好,我们目前无法与最新的 Selenium 4.10 一起运行我们的脚本。这是 Appium 错误还是 Python 错误?

这是我们使用的功能。我们当前正在尝试获取 platformName 的功能,targetOS = self.driver.capabilities['platformName']但遇到了此错误

capabilities = {
    "platformName": "Android",
    "appium:platformVersion": "11.0",
    "appium:deviceName": "emulator-5554",
    "appium:app": "/Users/faithberroya/Downloads/test.apk",
    "appium:automationName": "UiAutomator2",
    "appium:appPackage": "com.test.school.assignment.rc",
    "appium:appActivity": "com.test.school.assignment.ui.SplashActivity"
}

# launch app
context.driver = webdriver.Remote("http://0.0.0.0:4723/wd/hub", capabilities)
# add wait time
context.driver.implicitly_wait(20)
# app
context.app = Application(context.driver)
Run Code Online (Sandbox Code Playgroud)

当前点列表

Appium-Python-Client     2.10.1
behave                   1.2.6
certifi                  2023.5.7
pip                      23.1.1
requests                 2.31.0
selenium                 4.9.0
Run Code Online (Sandbox Code Playgroud)

python selenium-webdriver appium python-appium

11
推荐指数
2
解决办法
2万
查看次数