- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我打算使用 Java 中的 Selenium 在远程边缘浏览器中测试一个网站。但我无法找到远程边缘浏览器的代码。而在本地,我可以打开边缘浏览器并进行测试。
浏览器版本:- 微软边缘41.16299.1004.0 微软EdgeHTML 16.16299驱动程序版本:- 版本:5.16299 |支持的 Microsoft Edge 版本:16.16299
并且不存在版本问题,因为它与本地边缘浏览器一起使用。
到目前为止,我已经有了通过 Java 中的 Selenium 在本地打开边缘浏览器来测试网站的代码。 这工作正常。
System.setProperty( "webdriver.edge.driver",
System.getProperty("user.dir")+"/MicrosoftWebDriver.exe" );
HashMap<String, Object> edgePrefs = new HashMap<String, Object>();
edgePrefs.put("profile.default_content_settings.popups", 0);
EdgeOptions options = new EdgeOptions();
options.setCapability("prefs", edgePrefs);
options.setCapability("useAutomationExtension", false);
WebDriver driver = new EdgeDriver(options);
对于远程边缘浏览器,我有以下代码,它不起作用。
System.setProperty( "webdriver.edge.driver", System.getProperty("user.dir")+"/MicrosoftWebDriver.exe" );
URL hubUrl = new URL("http://wiqaseleniumhub.fmr.com:4444/wd/hub");
WebDriver driver = new RemoteWebDriver(hubUrl, DesiredCapabilities.edge());
使用 RemoteWebDriver for Edge 运行远程边缘浏览器时。低于错误。
Aug 07, 2019 4:50:14 PM org.openqa.selenium.remote.DesiredCapabilities edge
INFO: Using `new EdgeOptions()` is preferred to `DesiredCapabilities.edge()`
FAILED: planTypesAndPlanTest
org.openqa.selenium.WebDriverException: Error forwarding the new session cannot find : Capabilities {browserName: MicrosoftEdge, platform: WINDOWS, version: }
Command duration or timeout: 1.13 seconds
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)
at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$errorHandler$0(JsonWireProtocolResponse.java:54)
at org.openqa.selenium.remote.HandshakeResponse.lambda$getResponseFunction$0(HandshakeResponse.java:30)
at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:126)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:128)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:74)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:136)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:144)
at Utils.Functionality.edgeDriver(Functionality.java:90)
at Utils.Functionality.getDriver(Functionality.java:167)
at Utils.Functionality.fieldConfigTesting(Functionality.java:666)
at com.Automation.Test.AutomationMain.planTypesAndPlanTest(AutomationMain.java:211)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:583)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:719)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:989)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
at org.testng.TestRunner.privateRun(TestRunner.java:648)
at org.testng.TestRunner.run(TestRunner.java:505)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:455)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:450)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:415)
at org.testng.SuiteRunner.run(SuiteRunner.java:364)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1208)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1137)
at org.testng.TestNG.runSuites(TestNG.java:1049)
at org.testng.TestNG.run(TestNG.java:1017)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:114)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)
最佳答案
使用 Selenium 从 Jenkins 作业启动远程 Microsoft Edge 浏览器您需要使用 EdgeOptions()
,而不是使用 DesiredCapability()
,如下所示:
System.setProperty( "webdriver.edge.driver", System.getProperty("user.dir")+"/MicrosoftWebDriver.exe" );
EdgeOptions options = new EdgeOptions();
options.setCapability("useAutomationExtension", false);
URL hubUrl = new URL("http://wiqaseleniumhub.fmr.com:4444/wd/hub");
WebDriver driver = new RemoteWebDriver(hubUrl, options);
You can find a relevant discussion in How to Merge Chrome driver service with desired capabilities for headless using xvfb?
关于java - 使用 `new EdgeOptions()` 优于 `DesiredCapabilities.edge()` 通过 Jenkins 和 Selenium 启动远程 Microsoft Edge 浏览器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57393690/
我想显示一个图像(大于 iPhone 的屏幕),用户可以滚动。不难,我已经用这段代码完成了:在我的 .h 文件中 @interface mappa1 : UIViewController { IBO
bash 联机帮助页说: Redirecting Standard Output and Standard Error Bash allows both the standard output (fi
我将大量数据绑定(bind)到 TreeView 控件,因为数据是自然的类别层次结构。问题是它有很多。我已经设法通过仅绑定(bind)那些出现在可见树中的节点来消除大量开销,但这仍然在 ViewSta
我正在尝试为 mysql 操作与 redis 操作制作基准测试脚本。 这是我尝试过的: 1./ List of comment ids with a separate hash of comment
我很想知道是否有比 FileObserver 更好的方法来监视目录的文件更改/创建/删除。 FileObserver 需要持续引用它,这需要持续运行的服务,这很困难,也是一种不好的做法,对吧? 对于如
我创建了一个带有 NSOpenGLView 的窗口,我正在将 openGL 内容渲染到其中。 我想向 View 添加一些按钮和文本字段:我可以使用界面生成器(或代码)添加 NSTextFields 和
如何编码 JAXBElement 列表? 例如,我有一个无法注释的 POJO: public class APojo { private String aString; public APojo()
我正在开发一个博客,我的客户希望在其中使用大量图像(文章、标题、广告等)。他几乎不想要任何文本,因为他希望用阿拉伯语开发博客并且他对网络浏览器支持的任何字体都不满意,他也不想采用 EOT,他将每天更新
我想在文本字段上添加一个标签,该标签会在用户键入时发生变化。问题是文本字段的插入符号位于标签后面(如果我将标签放在文本字段前面)。我始终可以使文本字段的背景透明,并在标签和文本字段后面添加另一个禁用的
我正在尝试在 iOS 应用程序中创建一个特定的布局,其中“背景”是一个 MKMapView,覆盖层是一个 UIScrollView。这个想法是有两个屏幕,一个带有 map ,另一个带有一些附加信息。用
我需要在 UITableViewController 上放置一个 UIView,目前我是这样放置的 [self.navigationController.view addSubview:searchV
我有一个非常简单的问题要问:我需要在屏幕右下角的 ImageView 上放一个小 Logo ,整个屏幕都很大,但我不知道如何设置坐标或如何设置说 ImageViews 处于相对位置。 像这样: 最佳答
我试图让 mapView 覆盖整个 UITableViewCell 并禁用此 mapView 上的所有用户事件,但仍然可以单击单元格。但是,此 mapView(即使我将 subview 发送回)正在拦
我们即将获得 Java EE6(使用 Glassfish v3 作为引用实现)。计划发布时间为 12 月 9 日。虽然仍有相当多的公司正在努力将他们的代码库从早期版本迁移到 EE5,但我们处于开始开发
为什么(在 WPF、C#、 Entity Framework 中)将 ListBox 绑定(bind)到在 ObjectSet 上创建的 ObservableCollection(来自 Entity框
在 hibernate 中使用 @NamedQuery 而不是 @NamedNativeQuery 有什么好处,反之亦然。我无法发现确切的区别或在什么情况下我们应该使用 @NamedQuery 而不是
在 Dart 中,检查值是否为 == null似乎类似于检查它是否is Null .为什么前者更可取? 最佳答案 这是您正在进行的比较类型。在 == null ,您正在将对象/原始对象与 null 进
我使用的是 Java 1.6。我有一组项目,每个项目都有一个名称和一组组件。每个组件也有一个名称。 Set Class Item String name Set Class Compo
如果我想在我的应用程序中支持脚本,是否 scriptcs提供比仅使用普通 Vanilla 的任何特殊优势 Roslyn脚本引擎? 最佳答案 不幸的是,目前还没有太多关于托管 scriptcs 的文档,
我正在我的应用程序中使用 Struts 和 Spring jdbc 模板。 我必须在我们的代码中使用 Hibernate 模板。 谁能告诉我为什么要使用 Hibernate 模板? 使用 Spring
我是一名优秀的程序员,十分优秀!