c# - 在 Saucelabs 中使用 selenium c# 进行浏览器扩展测试

标签 c# selenium browser-extension saucelabs

是否可以在 Saucelab 中使用 selenium c# 测试浏览器扩展。如果是这样,如何以及在何处将最新的扩展包放置在 saucelab VM 中,以便 selenium 启动带有扩展的浏览器。

最佳答案

对于 Firefox 和 chrome,可以通过提供功能或配置文件来实现。例如在 firefox 的情况下:

File file = new File("firebug-1.8.1.xpi"); FirefoxProfile firefoxProfile = new FirefoxProfile(); firefoxProfile.addExtension(文件); firefoxProfile.setPreference("extensions.firebug.currentVersion", "1.8.1");//避免启动屏幕

WebDriver 驱动程序 = new FirefoxDriver(firefoxProfile);

关于c# - 在 Saucelabs 中使用 selenium c# 进行浏览器扩展测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27619760/

相关文章:

C# 类 : Accesing methods through instances

java - org.openqa.selenium.InvalidArgumentException : Invalid capabilities using DesiredCapabilities

JavaScript 完全 "tamper safe"变量

javascript - 在crossrider中将数据从background.js发送到extension.js

c# - 有没有办法限制 .NET Core 项目在使用 .NET Core 3.1 sdk 时只生成 .dll 作为输出文件

c# - 在 C# 中重用 xml

python - Scraper 无法从网站提取标题

javascript - 向浏览器扩展中的任何 url 发出网络请求

c# - 检查字符串是否包含 Enumerable.Range 过滤器列表中的匹配项

selenium - Selenium 中的继续 session 无法 getAttribute()