【问题标题】:Possibility to run automation tests on virtualized browser可以在虚拟化浏览器上运行自动化测试
【发布时间】:2016-08-11 15:47:38
【问题描述】:

我正在使用 C# + Selenium WebDriver 进行自动化测试。 我想知道是否有可能在虚拟化 AppV 5.1 浏览器(Firefox、Chrome)上运行测试。

我试过在%PROGRAMDATA%\App-V\<PackageId>\<VersionId>\Root\VFS\ProgramFilesX86\Google\Chrome\Application下将ChromeOptions.BinaryLocation设置为chrome.exe,但是不行。

每个测试都因错误而崩溃

    Error Message:
       Initialization method Am.Tests.Login_Test.Init threw exception. System.Invali
    dOperationException: System.InvalidOperationException: unknown error: cannot fin
    d Chrome binary
      (Driver info: chromedriver=2.22.397933 (1cab651507b88dec79b2b2a22d1943c01833cc
    1b),platform=Windows NT 6.1.7601 SP1 x86_64).
    Stack Trace:
        at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response err
    orResponse)
       at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecu
    te, Dictionary`2 parameters)
       at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredC
    apabilities)
       at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecu
    tor, ICapabilities desiredCapabilities)
       at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeOptions options)
       at Am.Logic.UiContext..ctor(Browser brw)
       at Am.Tests.Login_Test.Init()

请澄清

【问题讨论】:

  • 您能否将代码添加到您的问题以及任何错误?

标签: c# testing selenium-webdriver appv


【解决方案1】:

仅仅为那个 EXE 设置路径是不够的。当 App-V 应用程序启动时,App-V 客户端检测并接管其进程,在容器化气泡中运行它们。

与这些进程交互的唯一方法是在 bubble 中运行你的进程。您可以使用多种方法launch an external process in the App-V bubble

【讨论】:

  • @YuriyRozhkov ,能分享一下你是如何解决这个问题的吗?
  • @Ronaldo,不幸的是,我不再使用 AppV 包。但我确实记得这是简单直接的解决方案,例如从父浏览器 appv-package 上下文中运行 nunit 进程,如上文所述的 Bogdan $AppVName = Get-AppvClientPackage <chrome_appv_package>; Start-AppvVirtualProcess -AppvClientObject $AppVName nunit.exe <all_required_params>
猜你喜欢
  • 1970-01-01
  • 2011-11-14
  • 2013-09-23
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多