Wednesday, April 25, 2018

WinAppDriver a base for testing

I've been doing some automated UI testing using WinAppDriver.

Here's a simple base class I've been using for my tests that takes care of ensuring that the service app is running when the tests start.



If you're writing tests using WinAppDriver and are fed up with tests not running or false negatives when the exe isn't running and listening for requests, then check it out.

The check for it being installed is also useful when you first run on a new machine.

You may need to allow for untrusted PowerShell scripts or have VS running as an admin for everything to work.



Friday, March 23, 2018

UWP vs Web development

I recently heard someone try and make this argument. (They were sucking up to Microsoft at the time.)
If I do web dev I have to learn at least 4 things, but for Windows, I can just learn UWP
Their thinking was that for web development they need to learn:

  • HTML
  • CSS
  • Javascript
  • Some framework (e.g. Angular)
  • Possibly more...

They argued that they could just learn "UWP".
But I think that means several things too:

  • XAML
  • C# (or VB, or C++)
  • An MVVM framework (MVVM Light, Caliburn.Micro, Prism, etc.)
  • The UWP app model and platform-specific APIs
  • possibly more...

I don't think this argument holds up.
The development of any piece of non-trivial software requires the use of multiple complementary technologies, skills, and techniques. If you ever think you can just learn one thing and then you'll be done, you're setting yourself up for disappointment and failure.

There's a similar thing I've heard from other developers and that's:
I don't need to learn Android (or iOS) I can just learn Xamarin.
That's equally flawed and in similar ways.


Friday, March 16, 2018

Did someone really design this ATM experience?

As I put my card in the ATM machine today I noticed a message on the screen that said
Receipts currently unavailable
I've seen it many times before. It means the roll of paper the receipts are printed on has run out. Not a problem, I just want cash.

After inserting my card and entering my PIN number, among the many options were two related to what I wanted:

- Cash with receipt
- Cash with no receipt

Yes, that first option makes no sense based on the message shown at the start. But wait.
I selected the second option and was then asked:
Do you want a receipt for your transaction?
- Yes
- No

I selected "No". I didn't want one and, based on what the machine had said moments ago, I knew it couldn't provide one even if I did want it.

I then selected the amount I wanted to withdraw.

All should have been good but then I was asked, again:
Do you want a receipt for your transaction?
- Yes
- No

Again I selected "No" and finally my money was dispensed.

Part of me was glad to finally get my money.
Part of me was tempted to try that again and see if what would happen if I chose some of the impossible options.
And another part of me was saddened by the process.

Here are my issues with what happened:

  • The software repeatedly provided options for things it had said were unavailable.
  • The software asked the same question multiple times, seemingly disregarding my past answers.
  • The software made the process longer and more complicated than was necessary.


Someone was paid to make this software.
Someone tested and approved this software.
Someone thinks this is a good experience to give to their customers.
Someone thinks that we should trust them with our money inside complex financial systems when they make what should be a simple piece of software unnecessarily complex.


You wouldn't build software that provided an experience like this.
Would you?

Tuesday, February 06, 2018

Create UWP apps with VB.Net and Windows Template Studio

The majority of my open source software contributions over the last few months have focused on adding VB.Net support to Windows Template Studio (WTS).

WTS is a Visual Studio extension that provides a better File>New experience when creating UWP apps.

The aim is to help new developers start in a structured, conventional way that will help in the future but they may not even know to consider.
It also aims to help all developers by removing some of the plumbing and code that is needed by every app.

Using the wizard is a simple, three-step process.

File>New Project dialog

Start by selecting the project type and the framework you want to use.

Then, add any of the predefined pages

Finally, add code to handle any extra features.


It can't do everything for you and there will be some things you need to do with the generated code before everything will work as you need. To address this, the code includes comments that explain what you need to do. You'll find them in the TaskList window.

Its usefulness doesn't just end once the project is first generated. It will also help you add to a project you've already created. Just right-click on the project in solution explorer and you can add a page or a feature.


That's still not the end. WTS already supports five frameworks when working with C# and there's much more planned for the future, including: Xamarin.Forms support; more pages; more features; and other exciting new functionality too.

To get started using Windows Template Studio, download and install the VSIX from https://aka.ms/wtsinstall

Or, learn more about the project on GitHub at https://aka.ms/wts