SauceLabs 上带有 Selenium 4 的 Apple 平台挂在“让我们浏览!”上页

发布于 2025-01-17 14:15:10 字数 2383 浏览 0 评论 0原文

当我在 SauceLabs(作为平台配置器中定义的指南)和 Selenium 4 上启动任何 IOS 设备时,Safari 浏览器会初始化为 127.0.0.1,并显示一条消息“让我们浏览!”

之后,它似乎挂起,然后在 90 秒后超时。

请参阅: https://app.saucelabs.com/tests/c406b979336d4a33b1015722c14759bc

调试后我可以看到尽管我在 仪表板 中看到了测试,但我无法创建驱动程序对象:

25: try {
26:     //Console.WriteLine("About to create Driver");
27:     Driver = new SauceryRemoteWebDriver(new Uri(SauceryConstants.SAUCELABS_HUB), opts);
28:     } catch(Exception ex) {
29:        Console.WriteLine(ex.Message);
30:    }

上面的代码捕获了异常。 ex.Message 是“针对 URL http://ondemand.saucelabs 向远程 WebDriver 服务器发出的 HTTP 请求.com/wd/hub/session 60 秒后超时。”堆栈跟踪是:

   at OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(Command commandToExecute)
   at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.WebDriver.StartSession(ICapabilities desiredCapabilities)
   at OpenQA.Selenium.WebDriver..ctor(ICommandExecutor executor, ICapabilities capabilities)
   at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
   at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(Uri remoteAddress, ICapabilities desiredCapabilities, TimeSpan commandTimeout)
   at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(Uri remoteAddress, ICapabilities desiredCapabilities)
   at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(Uri remoteAddress, DriverOptions options)
   at Saucery.Driver.SauceryRemoteWebDriver..ctor(Uri remoteAddress, DriverOptions options) in C:\Personal\GitRepos\Saucery\Saucery\Driver\SauceryRemoteWebDriver.cs:line 9
   at Saucery.Tests.SauceryBase.InitialiseDriver(DriverOptions opts, Int32 waitSecs) in C:\Personal\GitRepos\Saucery\Saucery\Tests\SauceryBase.cs:line 27

这并没有告诉我太多信息。

尽管确认我正在按照 平台配置器 中指定的方式设置 DesiredOptions,但仍然如此。我认为平台配置器是错误的。

我没看到什么?我是否在为 IOS 平台做一些根本不正确的事情?

我的代码库非常适合所有桌面和 Android 平台。只有苹果平台悬而未决。

还有其他人遇到过这个吗?

When I launch seemingly any IOS device on SauceLabs (as defined on the platform configurator as a guide) and Selenium 4 the Safari Browser initialises to 127.0.0.1 with a message "Let's browse!"

After that it just seems to hang and then times out after 90 seconds.

See: https://app.saucelabs.com/tests/c406b979336d4a33b1015722c14759bc

After debugging I can see that despite me seeing tests in the dashboard, I am failing to create a driver object:

25: try {
26:     //Console.WriteLine("About to create Driver");
27:     Driver = new SauceryRemoteWebDriver(new Uri(SauceryConstants.SAUCELABS_HUB), opts);
28:     } catch(Exception ex) {
29:        Console.WriteLine(ex.Message);
30:    }

The above code catches the exception. ex.Message is "The HTTP request to the remote WebDriver server for URL http://ondemand.saucelabs.com/wd/hub/session timed out after 60 seconds." and the stacktrace is:

   at OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(Command commandToExecute)
   at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.WebDriver.StartSession(ICapabilities desiredCapabilities)
   at OpenQA.Selenium.WebDriver..ctor(ICommandExecutor executor, ICapabilities capabilities)
   at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
   at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(Uri remoteAddress, ICapabilities desiredCapabilities, TimeSpan commandTimeout)
   at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(Uri remoteAddress, ICapabilities desiredCapabilities)
   at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(Uri remoteAddress, DriverOptions options)
   at Saucery.Driver.SauceryRemoteWebDriver..ctor(Uri remoteAddress, DriverOptions options) in C:\Personal\GitRepos\Saucery\Saucery\Driver\SauceryRemoteWebDriver.cs:line 9
   at Saucery.Tests.SauceryBase.InitialiseDriver(DriverOptions opts, Int32 waitSecs) in C:\Personal\GitRepos\Saucery\Saucery\Tests\SauceryBase.cs:line 27

Which doesn't tell me much.

This is despite confirming that I am setting the DesiredOptions as specified in the Platform Configurator. Methinks the Platform Configurator is wrong.

What am I not seeing? Am I doing something fundamentally incorrect for IOS platforms?

My code base works perfectly well for all desktop and Android platforms. It is only Apple platforms that are hanging.

Has anyone else come across this?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

嗼ふ静 2025-01-24 14:15:10

要回答我自己的问题。

问题是设置默认超时。

明确将超时设置为较大的数字,使Apple模拟器足够长的时间以启动。

Going to answer my own question.

The issue was a default timeout being set.

Explicitly setting the timeout to a larger number gave the Apple emulator long enough to boot up.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文