本文介绍了可以在虚拟浏览器上运行自动化测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm working with automation tests on C# + Selenium WebDriver.I'd like to know if there is any possibility to run tests on virtualized AppV 5.1 browsers (Firefox, Chrome).

每个测试均因错误而崩溃

Each test crashes with error

    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()

请澄清

推荐答案

仅放置该EXE的路径是不够的.启动App-V应用程序时,App-V客户端会检测到是并接管其进程,并在容器化气泡中运行它们.

It is not enough to put the path for that EXE. When an App-V application is launched the App-V client detects is and takes over its process(es), running them in a containerized bubble.

与这些进程进行交互的唯一方法是也在 bubble 中运行您的进程.您可以使用两种方法在App-V气泡中启动外部进程

The only way to interact with those process is to run your process inside the bubble too. You can launch an external process in the App-V bubble using a couple of methods.

这篇关于可以在虚拟浏览器上运行自动化测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-22 10:06