使用时超时并提高。单击

发布于 2025-02-09 21:23:26 字数 1267 浏览 2 评论 0原文

我正在尝试在指令中禁用超时警报并传递超时参数:

Driver.FindElementById("ctl01_lnkCharacter", 5000, False).Click

我也尝试了以下情况,同样的情况发生了

Driver.FindElementById("ctl01_lnkCharacter", timeout:=5000, raise:=False).Click

超时参数(5000),并在超时的情况下不提高警报(false <false < /code>)被忽略。它使用默认的超时参数,或者如果它已经明确传递了该值,则假定该值。

我测试了将上述不同参数的测试进行测试:

Driver.Timeouts.PageLoad = 1500

Driver.FindElementById("ctl01_lnkCharacter", 5000, False).Click

在这种情况下,超时被认为是1500,而不是5000(我只是为了测试),并且“ false”被忽略,如果达到超时,则有一个错误警报。

在下面的指令中,它有效:

Driver.Get url, 2000, False

它尊重超时(2000),如果达到超时,则没有错误警报。

问题仅在.click语句中。

当我使用.findelementById(...)时。单击参数中传递的内容随着超时和加薪而被忽略。

.FindElementById("ctl01_lnkCharacter", TIMEOUT, RAISE).click

我尝试了一个变量,也许可以工作,例如,

var = Driver.FindElementById("ctl01_lnkCharacter", 5000, False)
var.click

该变量不接受。问题不是超时。我可以明确地通过超时。

问题是加薪,我需要在超时的情况下禁用错误警报。是否有其他方法可以在超时的情况下禁用错误警报(接下来没有使用错误简历)。

单击了按钮,页面打开正确,但是有时加载了一些图像,我不需要等待加载时间,并且需要很长的时间,而且此时间差异很大,而这些图像正在加载时,它会击中超时并生成错误。

这就是为什么我需要禁用超时错误警报(提高参数false)。

I'm trying to disable the timeout alert in an instruction and pass a timeout parameter:

Driver.FindElementById("ctl01_lnkCharacter", 5000, False).Click

I tried the below too, the same situation happens

Driver.FindElementById("ctl01_lnkCharacter", timeout:=5000, raise:=False).Click

The timeout parameters (5000) and raise for not to alert in case of timeout (False) are ignored. It uses the default timeout parameter, or if it has passed the parameter explicitly before, this value is assumed.

I tested passing the different parameter above to test:

Driver.Timeouts.PageLoad = 1500

Driver.FindElementById("ctl01_lnkCharacter", 5000, False).Click

In this case, the timeout is considered to be 1500 and not 5000 (I did this just to test) and the "False" is ignored, if it reaches the timeout there is an error alert.

In the instruction below it works:

Driver.Get url, 2000, False

It respects the timeout (2000) and if it is reached there is no error alert.

The problem is only in the .click statement.

When I use .FindElementById(...).click what is passed in the parameters as timeout and raise are ignored.

.FindElementById("ctl01_lnkCharacter", TIMEOUT, RAISE).click

I tried a variable, maybe it could works, for example

var = Driver.FindElementById("ctl01_lnkCharacter", 5000, False)
var.click

The variable is not accepted. The problem is not the timeout. I can pass the timeout before, explicitly.

The problem is the raise, I need to disable the error alert in case of timeout. Is there any other way to disable the error alert in case of timeout (without using On Error Resume Next).

The button is clicked correctly, the page opens correctly, but sometimes some images are loaded and I don't need to wait for the loading time and it takes a long time and this time varies a lot, while these images are loading it hits the timeout and generates the error.

That's why I need to disable the timeout error alert (raise parameter False).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文