0

Since Microsoft has said that Visual Studio 2019 is the last to include Coded UI, I am trying to move our Windows Desktop Application automation solution their recommended replacement, WinAppDriver.

I am having trouble getting the session going with the examples I have found online. Many C# examples, but I have not found any VB.NET examples.

The C# online Notepad example starts like:

DesiredCapabilities appCapabilities = new DesiredCapabilities();
appCapabilities.SetCapability("app", @"C:\Windows\System32\notepad.exe");
NotepadSession = new WindowsDriver<WindowsElement>(new Uri("http://127.0.0.1:4723"), appCapabilities);

I have successfully (I think) converted the first two lines to VB.NET like this:

Dim appCapabilities As DesiredCapabilities = New DesiredCapabilities()
appCapabilities.SetCapability("app", "C:\Windows\System32\notepad.exe")

I need to get the third line from the C# example code above converted to VB.NET so that we can hopefully get WinAppDriver working for our existing CodedUI automation solution.

ORNS
  • 107
  • 8
  • Why not code in C#? Personal preference? It might be easier to just code in C#, since much examples are written in C#. This way, you wouldn't have these conversion issues. – PixelPlex Apr 09 '19 at 07:43

1 Answers1

0

It's not clear where NotepadSession was declared, so you may need to change this some, depending on what kind of scope you need for the variable:

Dim NotepadSession As New WindowsDriver(Of WindowsElement)(New Uri("http://127.0.0.1:4723"), appCapabilities)
Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794