<i id='S6QaJ'><tr id='S6QaJ'><dt id='S6QaJ'><q id='S6QaJ'><span id='S6QaJ'><b id='S6QaJ'><form id='S6QaJ'><ins id='S6QaJ'></ins><ul id='S6QaJ'></ul><sub id='S6QaJ'></sub></form><legend id='S6QaJ'></legend><bdo id='S6QaJ'><pre id='S6QaJ'><center id='S6QaJ'></center></pre></bdo></b><th id='S6QaJ'></th></span></q></dt></tr></i><div id='S6QaJ'><tfoot id='S6QaJ'></tfoot><dl id='S6QaJ'><fieldset id='S6QaJ'></fieldset></dl></div>
        <bdo id='S6QaJ'></bdo><ul id='S6QaJ'></ul>
      <tfoot id='S6QaJ'></tfoot>
      1. <legend id='S6QaJ'><style id='S6QaJ'><dir id='S6QaJ'><q id='S6QaJ'></q></dir></style></legend>

        <small id='S6QaJ'></small><noframes id='S6QaJ'>

      2. 使用 Webinator+Selenium、SpecFlow 和 NUnit 进行多浏览器测试

        时间:2023-09-14

          <bdo id='wGy3B'></bdo><ul id='wGy3B'></ul>
              <tbody id='wGy3B'></tbody>
            • <i id='wGy3B'><tr id='wGy3B'><dt id='wGy3B'><q id='wGy3B'><span id='wGy3B'><b id='wGy3B'><form id='wGy3B'><ins id='wGy3B'></ins><ul id='wGy3B'></ul><sub id='wGy3B'></sub></form><legend id='wGy3B'></legend><bdo id='wGy3B'><pre id='wGy3B'><center id='wGy3B'></center></pre></bdo></b><th id='wGy3B'></th></span></q></dt></tr></i><div id='wGy3B'><tfoot id='wGy3B'></tfoot><dl id='wGy3B'><fieldset id='wGy3B'></fieldset></dl></div>

                1. <tfoot id='wGy3B'></tfoot>

                  <small id='wGy3B'></small><noframes id='wGy3B'>

                  <legend id='wGy3B'><style id='wGy3B'><dir id='wGy3B'><q id='wGy3B'></q></dir></style></legend>

                  本文介绍了使用 Webinator+Selenium、SpecFlow 和 NUnit 进行多浏览器测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在使用 Selenium 驱动程序开发一个带有 WebinatorSpecFlow+NUnit 的 ASP.NET MVC 3 应用程序.我在使用 Chrome(使用 chromedriver)和 Internet Explorer 运行并行测试时遇到问题.

                  I'm developing an ASP.NET MVC 3 app with WebinatorSpecFlow+NUnit using the Selenium driver. I'm having a problem running parallel tests with Chrome (using chromedriver) and Internet Explorer.

                  每当我通过 Webinator 在同一个会话中运行两个测试并由 Selenium 并行运行时,当我向页面发送任何点击操作时,IE 似乎都会挂起.

                  Whenever I have both tests running in the same session and in parallel by Selenium via Webinator, IE seems to hang when I send any click action to the page.

                  我无法使用此处建议的解决方案,因为 SpecFlow 会自动生成底层 C# 代码.我的解决方案的设计类似于 this(完整代码可作为要点提供):

                  I'm not able to use the solution suggested here, since SpecFlow generates the underlying C# code automatically. My solution is designed like this (the full code is available as a gist):

                  _multipleBrowsers.RunTest(web => web.GoToUrl("http://localhost/PROJECT/Authentication/Registration"));
                  

                  我会为每个需要测试的浏览器实例化一个新的 IWebManager.然后,我使用浏览器实例调用委托操作.它是这样的:

                  What happens is that I instantiate a new IWebManager for every browser I need to test. Then, I call the delegate action, using the browser instance. It goes like this:

                          foreach (var web in _webManagers)
                          {
                              Debug.WriteLine("Running test with " + web.Config.Browser);
                  
                              action(web);
                          }
                  

                  这样测试几乎可以并行运行.它会弹出一个浏览器,执行操作,然后是另一个浏览器,依此类推.

                  This way the tests run almost in parallel. It pops up a browser, execute the action, then the other browser, and so forth.

                  关于如何克服这个 ChromeDriver 问题有什么想法吗?我应该使用 SpecFlow 更改针对多个浏览器的测试方法吗?

                  Any thoughts on how to overcome this ChromeDriver issue? Should I change my testing approach with SpecFlow for multiple browsers?

                  参考资料:

                  • Webinator
                  • specflow
                  • nunit
                  • ChromeDriver

                  推荐答案

                  你可以更简单 只使用

                  然后你用标签@Browser:IE编写功能

                  Then you write feature with tag @Browser:IE

                  @Browser:IE
                  @Browser:Firefox
                  Scenario: Add comments
                         Given I navigated to /guinea-pig
                         And I have entered 'This is not a comment' into the commentbox
                         When I press 'submit' 
                         Then my comment 'This is not a comment' is displayed on the screen
                  

                  目前是我发现的最佳解决方案,因为它也可以在所有浏览器中进行测试,但在您需要的特定浏览器中进行测试

                  For now is the best solution which i found since it also make sence to test not in all browsers but in specific which you need

                  这篇关于使用 Webinator+Selenium、SpecFlow 和 NUnit 进行多浏览器测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:无法使用 Selenium Webdriver 打开 chrome 浏览器.管理员禁用加载解压缩的扩展程序 下一篇:如何通过 C# 中的 Selenium 伪造/模拟 ChromeDriver 中的地理位置?

                  相关文章

                  1. <i id='328nc'><tr id='328nc'><dt id='328nc'><q id='328nc'><span id='328nc'><b id='328nc'><form id='328nc'><ins id='328nc'></ins><ul id='328nc'></ul><sub id='328nc'></sub></form><legend id='328nc'></legend><bdo id='328nc'><pre id='328nc'><center id='328nc'></center></pre></bdo></b><th id='328nc'></th></span></q></dt></tr></i><div id='328nc'><tfoot id='328nc'></tfoot><dl id='328nc'><fieldset id='328nc'></fieldset></dl></div>

                      <bdo id='328nc'></bdo><ul id='328nc'></ul>
                    1. <small id='328nc'></small><noframes id='328nc'>

                    2. <tfoot id='328nc'></tfoot>
                    3. <legend id='328nc'><style id='328nc'><dir id='328nc'><q id='328nc'></q></dir></style></legend>