我正在使用Selenium RC自动执行某些浏览器操作,但我希望浏览器不可见.这可能吗?怎么样?那么Selenium Grid呢?我也可以隐藏Selenium RC窗口吗?
我用python,selenium和firefox运行这段代码,但仍然得到firefox的'head'版本:
binary = FirefoxBinary('C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe', log_file=sys.stdout)
binary.add_command_line_options('-headless')
self.driver = webdriver.Firefox(firefox_binary=binary)
Run Code Online (Sandbox Code Playgroud)
我也尝试了二进制的一些变体:
binary = FirefoxBinary('C:\\Program Files\\Nightly\\firefox.exe', log_file=sys.stdout)
binary.add_command_line_options("--headless")
Run Code Online (Sandbox Code Playgroud) python selenium python-3.x selenium-webdriver firefox-headless
当我同时执行多个测试时,我不想让Firefox浏览器窗口保持可见..我可以使用它来最小化它,selenium.minimizeWindow()但我不想这样做.
有没有办法隐藏Firefox窗口?我正在使用FireFox WebDriver.
在具有驱动GUI的端到端测试的项目上,在开发人员工作站上运行测试是很尴尬的,因为GUI自动化驱动程序会干扰桌面.它移动鼠标,从我们想要使用的应用程序中窃取焦点,并且如果我们在测试运行期间切换到另一个应用程序,则可以开始在错误的应用程序中键入文本.
在Linux上,我们通过在虚拟X服务器(xvfb或xnest)上运行测试中的应用程序来解决这个问题.使用xnest,我们可以观看运行的测试,但仍然可以使用真正的桌面而不受干扰.
Windows有什么相同的东西吗?
所以我正在尝试一些硒处理方法,我真的希望它能很快。
所以我的想法是,使用无头的chrome运行它可以使我的脚本更快。
首先,该假设是正确的,还是如果我使用无头驱动程序运行脚本并不重要?
无论如何,我仍然希望它能够正常运行,但是我不知何故,我尝试了不同的方法,并且大多数人建议它可以如十月更新中所说的那样工作
如何配置ChromeDriver通过Selenium以无头模式启动Chrome浏览器?
但是当我尝试这样做时,我得到了奇怪的控制台输出,但它似乎仍然不起作用。
任何小费表示赞赏。
python selenium google-chrome selenium-chromedriver google-chrome-headless
在工作中,我们完全测试GUI组件.问题在于,当测试套件运行时,弹出各种组件,窃取焦点或使其无法继续工作.我想到的第一件事是Xnest,但我想知道是否有一个更优雅的解决方案来解决这个问题.
我正在使用量角器进行测试.99%的时间没有必要真正看到浏览器,测试需要很长时间,而我们感兴趣的是最终结果.有没有办法隐藏为测试打开的浏览器(例如在后台运行)?
在这个字符串中存在数字li标签.我想获得标签的href属性,例如:
http://bipardeh94.blogfa.com" target="_blank
http://avaejam.blogfa.com" target="_blank
Run Code Online (Sandbox Code Playgroud)
并且......我希望用C#做到这一点.如何做到这一点?我使用此代码,但这不完整.
int indexStartUl = _codeHtml.IndexOf("<ul");
int indexEndUl = _codeHtml.IndexOf("</ul>");
_codeHtml = _codeHtml.Substring(indexStartUl, indexEndUl);
Run Code Online (Sandbox Code Playgroud)
请帮忙.
<ul class="ull">
<li><a href="http://bipardeh94.blogfa.com" target="_blank">??? ????</a><span class="ur">bipardeh94.blogfa.com</span><span class="ds">??????-????-????</span></li>
<li><a href="http://avaejam.blogfa.com" target="_blank">???? ???? </a><span class="ur">avaejam.blogfa.com</span><span class="ds"> ?? ???? ?? ???? ???? ???? ?? ??? </span></li>
<li><a href="http://prkangavar.blogfa.com" target="_blank">????? ????? ??????? ?????????? ??????</a><span class="ur">prkangavar.blogfa.com</span><span class="ds">????? ???????</span></li>
<li><a href="http://bordekhoun.blogfa.com" target="_blank">????? ????? ????? ??????</a><span class="ur">bordekhoun.blogfa.com</span><span class="ds">????????????? ?????? ?? ?????? ??????</span></li>
<li><a href="http://mahinvare.blogfa.com" target="_blank">????? ??? ????</a><span class="ur">mahinvare.blogfa.com</span><span class="ds">????? ??? ???? ?????? ???? ????? ???</span></li>
<li><a href="http://zanjanuniversity.blogfa.com" …Run Code Online (Sandbox Code Playgroud) 有什么办法可以在我的 vba 代码中使用那些被注释掉的四行,这样我就可以在进入一些容易通知的网页时摆脱障碍。我找不到任何想法,以便我能够利用它们,因为它们现在的情况会引发错误。这里是。提前致谢。
Sub Test_stth()
Dim driver As New WebDriver
'chrome_options = WebDriver.ChromeOptions()
'prefs = {"profile.default_content_setting_values.notifications" : 2}
'chrome_options.add_experimental_option("prefs",prefs)
'driver = WebDriver.Chrome(chrome_options = chrome_options)
With driver
.Start "chrome", "https://stackoverflow.com/documentation"
.get "/documentation"
End With
End Sub
Run Code Online (Sandbox Code Playgroud) selenium ×5
python ×4
testing ×2
c# ×1
e2e-testing ×1
firefox ×1
html ×1
protractor ×1
python-3.x ×1
selenium-rc ×1
string ×1
unit-testing ×1
vba ×1
webdriver ×1
windows ×1
x11 ×1