【问题标题】:Selenium Internet Explorer Driver, Kendo Mobile and Octopus DeploySelenium Internet Explorer 驱动程序、Kendo Mobile 和 Octopus Deploy
【发布时间】:2014-02-07 01:19:13
【问题描述】:

我们有一个使用 Kendo Mobile UI 组件的 MVC 5 C# Web 应用程序,我们使用 Octopus Deploy(Test、Staging、Prod)进行部署,并有一个步骤来运行 Selenium UI 测试。

该过程适用于使用 Selenium Chrome 驱动程序的所有环境,但是我们在服务器上的 Selenium Internet Explorer 驱动程序存在问题。

当作为 Octopus 部署过程的一部分运行时,UI 测试在服务器上失败。 如果您手动执行脚本(与 Octopus Deploy 进程相同的脚本和用户),则测试在本地开发中运行,并在服务器上运行。

我能看到的唯一区别是,一个是作为触手脚本执行的一部分无头运行,另一个不是。

我们收到以下错误:

触手脚本执行 OpenQA.Selenium.ElementNotVisibleException:元素未显示

我可以通过将 IE Web 驱动程序的选项更改为:

var options = new InternetExplorerOptions();
options.RequireWindowFocus = false;
var webDriver = new InternetExplorerDriver(options);

导致问题的元素是 Kendo 移动按钮:

<a data-role="button" data-rel="drawer" id="searchIcon" href="#searchDrawer" data-icon="search" data-align="left"></a>

【问题讨论】:

    标签: c# internet-explorer selenium kendo-ui octopus-deploy


    【解决方案1】:

    Tentacle windows 服务默认在本地系统下运行,但它没有任何 UI。 您需要授予服务与桌面交互的能力。以下链接可能会有所帮助:

    http://lostechies.com/keithdahlby/2011/08/13/allowing-a-windows-service-to-interact-with-desktop-without-localsystem/

    【讨论】:

    • 这不起作用,我们还尝试以管理员用户身份运行 tentacle 服务,但没有成功,当我们使用同一用户手动运行脚本时,它运行良好。更改后重新启动服务以确保。
    • 您能以交互方式运行 Tentacle 服务吗(只需停止服务,然后运行 ​​Tentacle.exe)看看是否有效?
    • 我们跟随octopusdeploy.com/blog/testing-powershell-scripts手动运行。第一次运行它失败了,但随后的所有时间它都工作了。我们尝试通过 UI 进行另一次部署,但失败了。
    • 以交互方式运行 Tentacle (tentacle.exe) 怎么样?
    • 是的,它以交互方式成功运行
    【解决方案2】:

    所有区域的保护模式必须相同。 答案见:https://stackoverflow.com/a/11123960/200824

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-10-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多