Search code examples
c#testingselenium-webdriverappv

Possibility to run automation tests on virtualized browser


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

I've tried to set ChromeOptions.BinaryLocation to chrome.exe under %PROGRAMDATA%\App-V\<PackageId>\<VersionId>\Root\VFS\ProgramFilesX86\Google\Chrome\Application, but it doesn't work.

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

Please clarify


Solution

  • 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.

    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.