Error #204 when autorun wants to be started after fresh extension installation

Hi,
I’m trying to automate web tests with the autorun ui.vision.html file together with C# and Selenium WebDriver. I followed your guide: paste autorun file with parameters to address bar and everything went well…cool :slightly_smiling_face:
But when I want to do with Selenium WebDriver in C# and fresh installation of extension, it does not work. The scenario is following:

  1. Start WebDriver (chromedriver) and Selenium with option chromeOptions.AddExtension(...). That installs the UI.Vision RPA extension. OK.
  2. The browser is opened and chromedriver is working. .
  3. But when paste same autorun file via chromedriver from Selenium: driver.Url = "file://...." I got an error message

Error #204: It seems UI.Vision RPA is not installed yet - or you need to turn on Allow access to file URLs for UI.Vision RPA in your browsers extension settings.

Sure, I did all the steps as well as follow one of your topics (Error #204 While running from script) but without success.

Then I’ve observed one thing. When the extension is installed and NOT opened yet (the main extension settings window of UI.Vision.RPA), then it throws mentioned error when autorun wants to start. In all cases. Manually, from C#…
When the settings window was sometimes already opened after installation, then the autorun will go fine.

So it seems that the extension needs to be somehow initialized before first autorun or is it normal behavior?
And from the C# Selenium WebDriver, is my suggested solution doable? So Selenium starts the chromedriver and then executes the autorun?

Thanks for suggestions.

Hi, this is an interesting test automation use case. But I wonder:

  • Even without the issue that you describe, directly after addon installation there would be no macro inside, or? How did you solve this?

  • Or do you automatically install the XModules as well, and use the hard-drive file storage?

XModules are already installed on Windows and I’m using hard-drive file storage. I was also trying search if is possible to somehow “start” the extension settings from chromedriver so it is initialized first but I wasn’t successful. Otherwise I have to find some workaround for that.

This is the screen I get.

I confirmed the issue. As you correctly assumed, the extension runs some setup processes when it is first started. We will check if we can run these procedures also directly after installation.

One possible workaround is that you use desktop automation (specifically web extension testing) to start and then close the extension once. This can be done by a preinstalled version of UI Vision in either a different browser (Firefox, Edge) or simply a different Chrome profile. Then the procedure would be:

  1. Use webdriver to install RPA extension

  2. Call macro in preinstalled UI.Vision (in other browser or profile) to click extension button once and then send XTYPE Alt+F4 to close it again.

  3. The fresh RPA installation is now ready to run your automation :slight_smile:

Thank you for quick response and suggestion. I was also wondering about solution you suggested but finally I decided for compromise.
Prerequisites:

  • Chrome has separate profile for testing (UIVisionUser)
  • extension installed, set and ready for use
  • XModules are installed
  • no other instance of Chrome browser is running

Then in my Selenium test I started the chromedriver with options

 chromeOptions.AddArgument("--user-data-dir=C:\\Users\\<username>\\AppData\\Local\\Google\\Chrome\\User Data");
 chromeOptions.AddArgument("--profile-directory=UIVisionUser");

Then I navigate chromedriver to the autorun file and voila…the test starts :slight_smile:

Btw. it would be really nice if it would be possible to set the home folder with parameter in command line (temporary or permament?). It could be very useful when configuring the test case in pipelines so you don’t have to rely on home folder setup in extension itself.