C#:Opera 58.x 的问题 |操作驱动程序 2.42 | Selenium 3.141 - 无法访问 Opera

如何解决C#:Opera 58.x 的问题 |操作驱动程序 2.42 | Selenium 3.141 - 无法访问 Opera

过去 10 年我一直从事产品开发和测试工作,几年前我接管了我们公司对我们的一种产品进行硒测试的研发工作。我正在更新我们的 C# 测试框架,该框架跨一系列浏览器测试我们产品的网络服务器功能。 PM 最近添加的浏览器之一是 Opera。目前,我们在我们的框架中使用以下版本控制:

Selenium WebDriver:V3.141.0.0 Selenium WebDriver.Support:V3.141.0.0 Operadriver_win64:V2.42 Opera 浏览器:58.0.3135.127

PM 指定我们必须确保我们为客户支持 Opera 58.x,因为这将在我们的下一个产品版本中记录给客户,因此很遗憾,我不得不针对此特定版本进行测试。

我在网上做了一些关于自动化 Opera 的广泛阅读。我从 GitHub 确定我需要为我的特定 58.x 版本的 Opera 安装operachromiumdriver v2.42。

I was a bit confused by this error because I can clearly see Opera started. So,I got looking at the logging for operadriver.exe:

Starting OperaDriver 2.42.3135 (O58) on port 37604
Only local connections are allowed.
[1612215723.848][INFO]: [0d995150afccdcc03195334ce4f36367] COMMAND InitSession {
   "capabilities": {
      "firstMatch": [ {
         "acceptInsecureCerts": true,"browserName": "opera"
      } ]
   },"desiredCapabilities": {
      "acceptInsecureCerts": true,"browserName": "opera","operaOptions": {
         "args": [ "--user-data-dir=C:\\Users\\System Test\\AppData\\Local\\Google\\Chrome\\Opera\\BlankUserData","--disable-extensions","--remote-debugging-port=37604" ],"binary": "C:\\Users\\System Test\\AppData\\Local\\Programs\\Opera\\58.0.3135.127\\opera.exe"
      }
   }
}
[1612215723.850][INFO]: Populating Preferences file: {
   "alternate_error_pages": {
      "enabled": false
   },"autofill": {
      "enabled": false
   },"browser": {
      "check_default_browser": false
   },"distribution": {
      "import_bookmarks": false,"import_history": false,"import_search_engine": false,"make_chrome_default_for_user": false,"skip_first_run_ui": true
   },"dns_prefetching": {
      "enabled": false
   },"profile": {
      "content_settings": {
         "pattern_pairs": {
            "https://*,*": {
               "media-stream": {
                  "audio": "Default","video": "Default"
               }
            }
         }
      },"default_content_setting_values": {
         "geolocation": 1
      },"default_content_settings": {
         "geolocation": 1,"mouselock": 1,"notifications": 1,"popups": 1,"ppapi-broker": 1
      },"password_manager_enabled": false
   },"safebrowsing": {
      "enabled": false
   },"search": {
      "suggest_enabled": false
   },"translate": {
      "enabled": false
   }
}
[1612215723.854][INFO]: Populating Local State file: {
   "ab_testing": {
      "uid": "MjRlNmUzZmEtNDJmNS00YTI3LWI4YTQtMTk1MTY2YmEwMTU3"
   },"background_mode": {
      "enabled": false
   },"browserjs": {
      "version": "1540378800"
   },"component_updater": {
      "widevine": {
         "up_to_date": false
      }
   },"hardware_acceleration_mode_previous": true,"location": {
      "country": "us","country_from_server": "unknown"
   },"partner_content": {
      "version": {
         "default": 61
      }
   },"password_manager": {
      "os_password_blank": false,"os_password_last_changed": "13255103709737702"
   },"shutdown": {
      "num_processes": 2,"num_processes_slow": 1,"performed": true,"type": 2
   },"ssl": {
      "rev_checking": {
         "enabled": false
      }
   },"startup_metric": {
      "last_startup_timestamp": "13256688446647647","last_startup_version": "71.0.3578.98","same_version_startup_count": 19
   },"subresource_filter": {
      "ruleset_version": {
         "checksum": 1918231743,"content": "9.18.0","format": 23
      }
   },"update": {
      "last_verify_time": "13256674004800030"
   },"updateclientdata": {
      "apps": {
         "aemomkdncapdnfajjbbcbdebjljbpmpj": {
            "cohort": "","cohortname": "","dlrc": 5145,"pf": "cc1d9041-3721-4533-b352-426560ac1a21"
         },"gcmjkmgdlgnkkcocmoeiminaijmmjnii": {
            "cohort": "1:bm1:xa9@0.01","cohortname": "M54ToM99","pf": "6fd7e0e8-4cbf-4fa5-9f1e-8f3d1990b5b7"
         },"hfnkpimlhhgieaddgfemjhofmfblmnib": {
            "cohort": "1:jcl:","cohortname": "Auto","pf": "e3b2fb1e-0ebb-45a6-a5e9-6a77ef613f0e"
         },"oimompecagnajdejgnnjijobebaeigek": {
            "cohort": "","pf": "2b5860db-7759-4ddf-b9ad-3ecceb3ec7c8"
         }
      }
   }
}
[1612215723.864][INFO]: Launching Opera: "C:\Users\System Test\AppData\Local\Programs\Opera\58.0.3135.127\opera.exe" --disable-background-networking --disable-client-side-phishing-detection --disable-default-apps --disable-extensions --disable-extensions-except="C:\Users\SYSTEM~1\AppData\Local\Temp\scoped_dir912_5937\internal" --disable-hang-monitor --disable-popup-blocking --disable-presto-profile-migration --disable-prompt-on-repost --disable-sync --disable-update --disable-usage-statistics-question --disable-web-resources --enable-automation --enable-logging --force-fieldtrials=SiteIsolationExtensions/Control --ignore-certificate-errors --log-level=0 --metrics-recording-only --no-default-browser-check --no-first-run --password-store=basic --ran-launcher --remote-debugging-port=37604 --test-type=webdriver --use-mock-keychain --user-data-dir="C:\Users\System Test\AppData\Local\Google\Chrome\Opera\BlankUserData"
[1612215723.870][DEBUG]: DevTools HTTP Request: http://localhost:37604/json/version
[1612215723.874][DEBUG]: DevTools HTTP Request failed
[1612215723.953][DEBUG]: DevTools HTTP Request: http://localhost:37604/json/version
[1612215723.954][DEBUG]: DevTools HTTP Request failed
[1612215724.014][DEBUG]: DevTools HTTP Request: http://localhost:37604/json/version
[1612215724.016][DEBUG]: DevTools HTTP Request failed
[1612215724.076][DEBUG]: DevTools HTTP Request: http://localhost:37604/json/version
[1612215724.079][DEBUG]: DevTools HTTP Request failed
[1612215724.140][DEBUG]: DevTools HTTP Request: http://localhost:37604/json/version
[1612215724.141][DEBUG]: DevTools HTTP Request failed
[1612215724.217][DEBUG]: DevTools HTTP Request: http://localhost:37604/json/version
[1612215724.220][DEBUG]: DevTools HTTP Request failed
[1612215724.283][DEBUG]: DevTools HTTP Request: http://localhost:37604/json/version
[1612215724.285][DEBUG]: DevTools HTTP Request failed
[1612215724.360][DEBUG]: DevTools HTTP Request: http://localhost:37604/json/version
[1612215724.364][DEBUG]: DevTools HTTP Request failed
[1612215724.425][DEBUG]: DevTools HTTP Request: http://localhost:37604/json/version
[1612215724.448][DEBUG]: DevTools HTTP Request failed
[1612215724.518][DEBUG]: DevTools HTTP Request: http://localhost:37604/json/version
[1612215724.854][DEBUG]: DevTools HTTP Request failed
[1612215724.946][INFO]: [0d995150afccdcc03195334ce4f36367] RESPONSE InitSession ERROR unknown error: Opera failed to start: crashed
  (Opera not reachable)
  (The process started from chrome location C:\Users\System Test\AppData\Local\Programs\Opera\58.0.3135.127\opera.exe is no longer running,so OperaDriver is assuming that Opera has crashed.)
[1612215724.983][DEBUG]: Log type 'driver' lost 0 entries on destruction
[1612215724.997][DEBUG]: Log type 'browser' lost 0 entries on destruction

当我使用 nunit 作为管理员运行上面的代码时,会依次发生以下 3 件事:

  1. Operadriver.exe 控制台窗口启动
  2. OperaSoftware.OperaWebBrowser.1610649940 控制台窗口启动
  3. Opera.exe 实例启动

此时,nunit 提示本次测试出现如下错误: SystemTest_S7_1200.Communications._45WebServer._456_WebServer_Opera._45001_BasicFunctionality: 设置:OpenQA.Selenium.WebDriverException:未知错误:Opera 无法启动:崩溃 (Opera 无法访问) (从 chrome 位置 C:\Users\System Test\AppData\Local\Programs\Opera\58.0.3135.127\opera.exe 开始的进程不再运行,因此 OperaDriver 假设 Opera 已崩溃。) (驱动程序信息:OperaDriver=2.42.3135 (O58),平台=Windows NT 10.0.17763 x86_64)

[8116:8468:0201/164204.426:ERROR:tcp_socket_win.cc(355)] bind() returned an error: Only one usage of each socket address (protocol/network address/port) is normally permitted. (0x2740)
[8116:8468:0201/164204.442:ERROR:tcp_socket_win.cc(355)] bind() returned an error: Only one usage of each socket address (protocol/network address/port) is normally permitted. (0x2740)
[8116:8468:0201/164204.473:ERROR:devtools_http_handler.cc(295)] Cannot start http server for devtools.
[8116:3184:0201/164205.297:ERROR:gpu_process_transport_factory.cc(967)] Lost UI shared context.

在 OperaSoftware.OperaWebBrowser 控制台中,记录了以下内容:

<head>
</head>
<body>
<table border='2' cellpadding='20' align='center'>
    <tbody>
    <tr>
        <td class="switch">1</td>
        <td class="switch">2</td>
        <td class="switch">3</td>
    </tr>
    </tbody>
</table>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js">
</script>
<script type="text/javascript">
    $('\.switch').click(function() {
        $(this).toggleClass('highlight');
        $(this).click(function() {
            $(this).toggleClass('highlight2');
        })
        $(this).click(function() {
            $(this).toggleClass('switch');
        })
    })
</script>
<style>
    .highlight {
        background-color: #ffff00;
    }
    .highlight2 {
        background-color: red;
    }
</style>
</body>

我知道我真的很接近让它工作......我认为这里的障碍是 DevTools HTTP 请求在多次尝试时失败,最终导致 InitSession 失败,因为它无法到达/附加到歌剧。

我的问题……我在这里遗漏了什么?对于我们测试的其他浏览器,如 Chrome、IE11、FF 等,启动 webdriver 并附加到浏览器实例一点也不难。恐怕我错过的任何东西都是显而易见的,而我只是没有看到。当然,根据我在网上的研究,在使用 Opera 进行测试时,我没有看到任何明确和明确的内容。被绑定到特定版本使这个问题更像是一个障碍。非常感谢任何输入。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-
参考1 参考2 解决方案 # 点击安装源 协议选择 http:// 路径填写 mirrors.aliyun.com/centos/8.3.2011/BaseOS/x86_64/os URL类型 软件库URL 其他路径 # 版本 7 mirrors.aliyun.com/centos/7/os/x86
报错1 [root@slave1 data_mocker]# kafka-console-consumer.sh --bootstrap-server slave1:9092 --topic topic_db [2023-12-19 18:31:12,770] WARN [Consumer clie
错误1 # 重写数据 hive (edu)&gt; insert overwrite table dwd_trade_cart_add_inc &gt; select data.id, &gt; data.user_id, &gt; data.course_id, &gt; date_format(
错误1 hive (edu)&gt; insert into huanhuan values(1,&#39;haoge&#39;); Query ID = root_20240110071417_fe1517ad-3607-41f4-bdcf-d00b98ac443e Total jobs = 1
报错1:执行到如下就不执行了,没有显示Successfully registered new MBean. [root@slave1 bin]# /usr/local/software/flume-1.9.0/bin/flume-ng agent -n a1 -c /usr/local/softwa
虚拟及没有启动任何服务器查看jps会显示jps,如果没有显示任何东西 [root@slave2 ~]# jps 9647 Jps 解决方案 # 进入/tmp查看 [root@slave1 dfs]# cd /tmp [root@slave1 tmp]# ll 总用量 48 drwxr-xr-x. 2
报错1 hive&gt; show databases; OK Failed with exception java.io.IOException:java.lang.RuntimeException: Error in configuring object Time taken: 0.474 se
报错1 [root@localhost ~]# vim -bash: vim: 未找到命令 安装vim yum -y install vim* # 查看是否安装成功 [root@hadoop01 hadoop]# rpm -qa |grep vim vim-X11-7.4.629-8.el7_9.x
修改hadoop配置 vi /usr/local/software/hadoop-2.9.2/etc/hadoop/yarn-site.xml # 添加如下 &lt;configuration&gt; &lt;property&gt; &lt;name&gt;yarn.nodemanager.res