在VM(c#/ Safari 12 / macOS 10.13)上执行测试时,有什么问题,请您帮我。
Selenium.Support: version=3.141.0
Selenium.WebDriver version=3.141.0
SpecFlow version="2.1.0
我抓到了
Current window:page-6CF4B0C0-1AD6-43A0-8E64-2F9EC720E260 New window:page-6CF4B0C0-1AD6-43A0-8E64-2F9EC720E260 error:
Request body does not contain required parameter 'handle'.
Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:13:22.693Z'
System info: host: 'itako39021.prod.miso', ip: 'fe80:0:0:0:1093:5dbf:b722:61c9%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.6', java.version: '9.0.4'
Driver info: driver.version: unknownRequest body does not contain required parameter 'handle'.
Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:13:22.693Z'
System info: host: 'itako39021.prod.miso', ip: 'fe80:0:0:0:1093:5dbf:b722:61c9%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.6', java.version: '9.0.4'
Driver info: driver.version: unknownOpenQA.Selenium.WebDriverException:
Request body does not contain required parameter 'handle'.
Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:13:22.693Z' System info: host: 'itako39021.prod.miso', ip: 'fe80:0:0:0:1093:5dbf:b722:61c9%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.6', java.version: '9.0.4' Driver info: driver.version: unknown at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters) at OpenQA.Selenium.Remote.RemoteTargetLocator.Window(String windowHandleOrName) at ServiceChannel.Specflow.Support.PageObjectBase.SwitchTab() in D:\Work\Project1\ServiceClick\ServiceChannel.Specflow\Support\PageObjectBase.cs:line 168 at ServiceChannel.Specflow.ServiceClick.Steps.ClickOnAllMenuItemsSteps.WhenTheUserSwitches(String type) in D:\Work\Project1\ServiceClick\ServiceChannel.Specflow\ServiceClick\Platform\Steps\ClickOnAllMenuItemsSteps.cs:line 73 at lambda_method(Closure , IContextManager , String ) at TechTalk.SpecFlow.Bindings.BindingInvoker.InvokeBinding(IBinding binding, IContextManager contextManager, Object[] arguments, ITestTracer testTracer, TimeSpan& duration) at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStepMatch(BindingMatch match, Object[] arguments) at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStep(StepInstance stepInstance) at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep() at TechTalk.SpecFlow.TestRunner.CollectScenarioErrors() at ServiceChannel.Specflow.ServiceClick.Proposals.Features.CreateProposalFeature.ScenarioCleanup() at ServiceChannel.Specflow.ServiceClick.Proposals.Features.CreateProposalFeature.CreateProposalByProvider() in D:\Work\Project1\ServiceClick\ServiceChannel.Specflow\ServiceClick\Proposals\Features\CreateProposal.feature:line 102 at TechTalk.SpecRun.Framework.TaskExecutors.StaticOrInstanceMethodExecutor.ExecuteInternal(ITestThreadExecutionContext testThreadExecutionContext) at TechTalk.SpecRun.Framework.TaskExecutors.StaticOrInstanceMethodExecutor.Execute(ITestThreadExecutionContext testThreadExecutionContext) at TechTalk.SpecRun.Framework.TestAssemblyExecutor.ExecuteTestNodeTask(TestNode testNode, ITaskExecutor task, TraceEventType eventType)
答案 0 :(得分:1)
您的问题是由于Safari 12使用新的网络驱动程序协议引起的。这导致了一些不兼容的问题。已在此处报告了问题:https://github.com/SeleniumHQ/selenium/issues/6026
您可以向safaridriver传递--legacy标志一个旧协议,该协议由mjdease发布在https://github.com/SeleniumHQ/selenium/issues/6026
const webdriver = require('selenium-webdriver');
const safari = require('selenium-webdriver/safari');
new webdriver.Builder()
.usingServer(await new safari.ServiceBuilder().addArguments('--legacy').build().start())
.forBrowser('safari')
.build();