c# - Selenium C# - 无法建立连接,因为目标机器主动拒绝它
问题描述
在这个 If-block 中总是抛出这个异常
if (browser.Url.StartsWith("https://account"))
{
browser.FindElementByCssSelector("input[type='password']").SendKeys(this.Password);
Thread.Sleep(2000);
this.SearchClickable(browser, "button[type='button']"); // searches for elements by this selector and clicks first clickable element of result
}
我搜索了解决方案,一位用户说要启动 Selenium Server。我使用以下命令启动它
java -jar C:\Users\User\Downloads\selenium-server-standalone-3.141.59.jar -role hub
但无论如何,硒仍然会引发该异常。我做错了什么还是问题不同?
解决方案
推荐阅读
- vue.js - 页面刷新后如何在Vuex中重新打开websocket连接?
- css - 如何更改“导航栏背景颜色”和“按钮颜色”?
- android - 无法在 Activity 和 Fragment 之间共享 Viewmodel:
- python - 如何将我的 shell 扫描脚本嵌入到 Python 脚本中?
- ruby-on-rails - 我如何从商店 HTML 中渲染 Rails 代码
- python - 如何点击 div 类元素
- postgresql - 如何在 PostgreSQL 云 sql 上查找连接泄漏
- json.net - 安装包“Newtonsoft.Json”时出错
- sapui5 - 如何更改灵活列布局中的列宽/比例?
- c++ - 堆栈输出错误