在这里超级初学者。尝试使用Ruby与Selenium Webdriver更新此测试。
driver = Selenium::WebDriver.for :remote, desired_capabilities: :firefox
当我尝试运行测试时,我在CMD中遇到的错误是
“警告Selenium [rebecation] [:desired_capabilities]:Desired_capabilities作为驾驶员初始化的参数是折衷的。反而。”
因此,我试图找到示例如何抑制此链接,但是我很难找到如何实现该链接的示例。
我还试图查找只使用功能的几种方法:正如建议的那样,但是我也很难为此找到资源,因此我只是四处乱逛,尝试了不同的组合,但无济于事。
好奇是否有人知道可以帮助我找到答案的任何东西?
还可以查看这些来源
基于上一个链接,我相信以下是可行的吗?但是我敢肯定,我只是错过了语法。
驱动程序= selenium :: webdriver.for:remote :: cababilities.firefox
Super beginner here. Trying to update this test with Selenium WebDriver using Ruby the course I was going through uses the below which is deprecated.
driver = Selenium::WebDriver.for :remote, desired_capabilities: :firefox
The error I'm getting in cmd when I try to run the tests is
"WARN Selenium [DEPRECATION] [:desired_capabilities] :desired_capabilities as a parameter for driver initialization is deprecated. Use :capabilities with an Array value of capabilities/options if necessary instead."
So I've tried to find examples of how to suppress the error mentioned in This Link, but I'm having trouble finding examples of how to implement that.
I've also tried to look up several ways to just use capabilities: as suggested, but I'm having trouble finding resources for that also, so I've just messed around and tried different combinations to no avail.
Curious if anyone knows of anything that would help me find the answer for this?
Also looked at these sources
Based off the last link, I believe the below should work? But I'm sure I'm just missing something with syntax.
driver = Selenium::WebDriver.for :Remote::Capabilities.firefox
发布评论
评论(1)
硒的能力不是在Ruby中应在的位置。您想现在避免完全使用功能。
这是硒文档中的一个示例,其中包括A之前/之后如何正确使用选项: https://www.selenium.dev/documentation/webdriver/getting_started/upgrade_to_selenium_4/#before
它与其他Selenium语言不匹配,所以我打算在Selenium 4.3 4.3中更改折旧让他们匹配。
Selenium capabilities are not where they should be in Ruby. You want to avoid using Capabilities entirely now.
Here's an example in the Selenium documentation with a before/after for how to use Options properly: https://www.selenium.dev/documentation/webdriver/getting_started/upgrade_to_selenium_4/#before
It does not match how the other Selenium languages do things, so I'm planning to change the deprecations in Selenium 4.3 to get them to match.