All posts by Mindful tester

Fast Forwarding Slow Down

On the day of my talk about TDD in Test Automation the meetup was postponed.

Painting

One month later I was still exploring Test Driven Development or TDD. The talk is still available. In this blog post I will write about my latest experiences.

Test automation is about programming and TDD is about programming. In a talk Kent Beck told about crazy ideas, which would bring him laughter. TDD in Test Automation made me laugh. What was holding me back?

“What is holding me back?”
Kent Beck about Explore at YOW! Conference 2018.

In TDD there is a continuous loop of Red, Green, and Refactor. Red is writing a failing test. Green is writing enough code to let the test pass. Refactor is clean up the code.

Refactor is like something like “Let me put that recurring piece of code in 1 method”. This sounds easy, but it is still tempting to optimise during coding or Green. I already made the optimised code, so why should I spend more time on refactoring? There might be a chance that I miss 2 out of 3 improvements.

A post it with the text Red posing to the post it with the text Green, pointing to the post it to the post it "Refactor". The Refactor post it points to the Red post it!

Myself

A common pattern in test automation is Arrange, Act, and Assert. The first phase is to arrange that everything is ready for testing. E.g. I am logged in with the right user name and password on the right website. The second phase is to act or do something, which must be checked. E.g. I have to press on this button, so a dialog will pop up. The third and last phase is to assert or check, whether the result is right. E.g. I can see a dialog.

At that moment I had two patterns to work with:

  1. Arrange Act Assert
  2. Red Green Refactor

On a high level I used Arrange, Act, and Assert for the general structure. On a low level I used the Red Green Refactor cycle to make the code. So the Assert block contained several Red Green Refactor cycles. A cycle can also be shown as a serie of actions.

In the upper part there is a rectangle "Assert". Under this rectangle there are two groups rectangles "Red", "Green", "Refactor". The left group is lower than the right group!

In the next image I add Arrange and Act. For my convenience I abbreviated to “Red, Green, Refactor” to “RGR”.

There are 3 rectangles, Arrange, Act, and Assert. Under the rectangle Assert RGR is written twice. The left RGR is lower than the right RGR!
In order to improve my skills I used the Selenium WebDriver with Java course of Angie Jones. It was very free, very good, and filled with useful code.

My deliberate practice exercise was to see, whether I could log in via the link Form Authentication on https://the-internet.herokuapp.com/.  See chapter 4.2 of the course.

In the corner

Maybe you noticed that I started with Assert. But why did I start with the Assert?
Frankly I cannot remember it. Maybe Assert was my final destination for my test script. Or perhaps I used Red Green Refactor on the wrong level. Any way I had a starting point for my test automation script.

public class LoginTests {
SecureAreaPage secureAreaPage = new SecureAreaPage();

@Test
public void testSuccesfulLogin(){
  Assert.assertEquals(secureAreaPage.getMessage(),
    "You logged into a secure area!",
    "Alert text is incorrect.");
}

In SecureAreaPage.java I made a method for the class SecureAreaPage:

public String getMessage(){
  return "ran394594";
}

So I made my failing test. Red.

Now I could easily pass this test by changing the return value in SecureAreaPage.java. Green.

public String getAlertText(){
  return "You logged into a secure area!";
}

At this moment I had a problem. There was no connection with the website. The test would always pass regardless of the correctness of the form authentication.

Looking back I could even use the code to test pizzas. The test results would be of no value. What about testing that gravity is pulling me sideways? Same story. I must have been sleeping on my right side. The wrong side.

I needed to make some code to connect the website and Assert.
In the next blog post I will start with Arrange.

Test Automation is a quick way to check items in a web site. Fast Forwarding.
Coding is an activity which still needs consideration. Slow Down.

Find That Thing In The Room

80 % is not good enough.

A lot of readers might wonder about this statement. 80 % is quite good. Unless your boss does not accept any mistakes. But Agile is the new norm, so learn and adapt. Errors are some great and uncomfortable way to learn.

On the other hand a test automation result should not be right in 80 % of the cases. Especially when it was executed several times within 15 minutes. It is difficult for me to interpret these results.

My draft FAQ for test automation

This one is not perfect, but it will be better at the end of this blog post.

Q: What to do, if I always have a No Such Element Exception?
A: There is a good chance, that the web element cannot be found. So my way to locate the web element is bad. There are several ways to find a web element.

A: What to do, if I always have a Stale Element Exception?
A: There is a high chance, that TestNG is used. The element to be used cannot be found any more. In this can use a findElement as late as possible.

Q: What to do, if I have a No Such Element Exception once in a while?
A: My solution was to retry the required action. After an exception I would wait and try again.

Boolean individualOrderNotFound = false;
For (int i = 0; i < 3 && !individualOrderNotFound; i++){
  try {
      findElement(xpath).click();
      individualOrderNotFound = true;
  }
  catch(NoSuchElementException e){
      Thread.sleep(2000);
  }
}

Q: What to do, if I have a Stale Element Exception once in a while?
A: See the answer on the previous question.

Q: Would you like to write a blog post about it?
A: You are reading one of the blog post serie.

Q: Do you have anything to add?
A: Sure. How about from 80 % to 100% reliability?

Q: Why is 80 % not good enough?
A: If you perform a test, then the result cannot be trusted.

Q: I would just execute the test several times. 80 % of the results would point in the right direction.
A: So you take extra test execution for granted. And what if 90% of the test results are the same. Do you still execute tests until you get to 80 %?

Q: This is supposed to be a frequently asked questions.
A: You are right. Now it is a dialogue. Does it matter?

Q: I am the person who should be posing the question.
A: Why?

Pretty sure

The morale of the following story is that statistics should be used carefully to help your customers. So you can go straight to the next chapter with more Java and Selenium stuff.

Content warning: the following story contains a scene about a date with an unfortunate ending.

Imaginary situation in the cinema more than 2 decades ago. I am recognized by one of the employees.

Me: “I want to have a Cola.”
Employee: “Here you are. And the nachos and the hot sauce.”
Me: [puzzled] “How did you know that?”

Employee: “You always have the Nachos, if you order the Cola.”
Me: “Yes, you are right. I also want to order a Lemonade.”
Employee: “With a chance of 80 % …”
Employee: [Writes something on the cup and places the drink with a wink] “Here you are.”

Me: [Surprised] “What did you write??”
Brunette: [Walks to the counter] “Amy! Who is Amy?”
Me [Turning to the lady with a cramped smile.]
Employee: “Hi Amy.”

Me [Turning to the blond lady with a cramped smile.]
Brunette [Turning to the blond lady] “I am 5 minutes away and …”
Brunette: [Picks up my drink and throws it over me. Walks away angrily.]

Me: “And Amy, did you figure out the situation with the pointers?”
Young man [Approaches counter]: “So, that’s why you are interested in programming.”
Young man [Picks up the drink of Amy and pours over me. Walks away angry]

Amy: [Sighs] “I finally found a young man, who wants to talk about programming.”
Amy: [Picks up my hot sauce and pours it over me. Followed by the nachos]
Amy [Walks away angrily]

Employee: “If this get worse, I pay you bill. 100 % chance of no way.”
A TV crew pops up. A woman with a microphone: “People do the strangest things to stand the desert heat of the desert scene of Monsters Unlimited. More at 9. What is the cooling effect of Nachos and the hot sauce?”

Employee: [Shows receipt with a message: the receiver gets a lifetime membership of Cinema Hype VIP.]
[The sound of a paper being shredded.]

[The end]

Say it again Sam

Back to reality.
In my office I had the following quality check of my automation scripts. If a script would pass in 4 out of 5 cases, then it would be good. OK next test.

Now I had my honour to make my test results 100 % reliable.

The biggest advantage of the Cinema Hype VIP application was the two stage order. First an order could be placed for the movie tickets, so the seats were reserved. On the day of the movie drinks and snacks could be added to the order.

Let me try to remember what happened.
On first sight the actions were not that complicated:

  • Select a day.
  • Select a movie.
  • Select a time slot.

What did I see on screen?
There were 7 buttons to select a day. I implemented this step flawlessly.

The next step was to select the right movie in a combo box. I really liked Outside In, which would be shown from Thursday.

 
WebElement moviesComboBox = driver.findElement(By.xpath(contains(@id,
                                     “moviesComboBox”));
filterCombobox.click();
selectMovieOption();
filterField.sendKeys(“Outside In”);
filterField.sendKeys(Keys.ENTER);

The selection in the combo box went wrong: Stale Element Exception.

Maybe a loop might solve this problem.

Boolean individualOrderNotFound = false;
For (int i = 0; i < 3 && !individualOrderNotFound; i++){
  try {
      WebElement moviesComboBox = driver.findElement(By.xpath(contains(@id,
                                     “moviesComboBox”));
      filterCombobox.click();
      selectMovieOption();
      filterField.sendKeys(“Outside In”);
      filterField.sendKeys(Keys.ENTER);
      individualOrderNotFound = true;
  }
  catch(StaleElementException e){
      Thread.sleep(2000);
  }
}

After some tweaking I got No Such Element Exception. I also added this exception, but it did not help.

 
Boolean individualOrderNotFound = false;
For (int i = 0; i < 3 && !individualOrderNotFound; i++){
  try {
      WebElement moviesComboBox = driver.findElement(By.xpath(contains(@id,
                                     “moviesComboBox”));
      filterCombobox.click();
      selectMovieOption();
      filterField.sendKeys(“Outside In”);
      filterField.sendKeys(Keys.ENTER);
      individualOrderNotFound = true;
  }
  catch(StaleElementException e){
      Thread.sleep(2000);
  }
  catch(NoSuchElementException e){
      Thread.sleep(2000);
  }
}

I found my monster in the room. So I asked for help.

A tester from another team replaced the loop for the movie selection by a couple of sleeps.

Thread.sleep(2000);
filterCombobox.click();
Thread.sleep(2000);

selectMovieOption();
filterField.sendKeys(“Outside In”);
filterField.sendKeys(Keys.ENTER);

The code was a bit slower, but more reliable. 5 out of 5 passed. I better got used to this.

Hypothetical causes

Retrospecting my coding was not pleasant. I did not stick to my own FAQ. And this can happen.

Now let me focus on the working code.
My fellow tester gave me the tip to use sleep. This way any delays would be handled.

There were two statements “filterCombobox.click();” and “selectMovieOption();”, which were preceded with sleeps. Therefore there were two places where exceptions could occur. In my loop I assumed that there was only one place for exceptions. The worst part was that I picked the wrong action.

Let me illustrate, what would happen, if I handle exceptions by starting over at the wrong spot.
I have a recipe for baking. I have enough flour and more than enough eggs. First I find the flour. Everything goes right: there is no exception. Then I put 200 gram of flour into a bowl.

For the second step I pick an egg. I break the egg and the smell is bad. That is an exception. The egg goes into the wastebin. So I start all over. I empty the bowl.

First step I have to weigh the flour, but there is no flour any more. Now I have an exception and I cannot finish the recipe.

A much better way to find a good egg without throwing away the flour.

This is something I need to research.

Final Fantast I C Assert

At the end of every regression test there should be one final check. A simple yes or no would indicate, whether the test has passed. For the cinema reservation system this was quite simple. Has the order for the tickets, drinks, and snacks sent to the cinema?

I let Selenium set the search field to Order Id and enter the Order id. I saw a Stale Element Exception. Time for my FAQ. I used findElement at the latest moment. Stale Element Exception.

I let Selenium switch to another menu and back to the right page to continue.
Stale Element Exception.

Which other steps were possible?
I let Selenium log off and log on. A search of the Order Id followed.
The order was not found, so it was sent. Test passed.

Another look at Continuous Delivery

It was like delivering a message. If one way did not work out, another way was explored. What had a mail delivery person, a milk delivery person, and a mail delivery teacher in common?

They all wanted to deliver a letter to Mr. H. Potter. Persistence paid off. And be nice to the messenger. The delivery story had a nasty tail.

Deliberate Practice

Of course this post should end with some smart code.

While blogging I was going through the chapters of the free course about Selenium WebDriver and Java of Angie Jones on the Test Automation University. In Chapter 9 about Wait Strategies I found FluentWait. One of the cool things about this command, that it could ignore exceptions.

A part of the solution was:

Thread.sleep(2000);

selectMovieOption();

This code was not optimal. If the environment or network is changed, then the sleep time might be adopted each time. A FluentWait would provide a robust and fast solution in this case.

FluentWait wait = new FluentWait(driver)
  .withTimeout(Duration.ofSeconds(8))
  .pollingEvery(Duration.ofSeconds(1))
  .ignoring(NoSuchElementexception.class);
wait.until(ExpectedConditions.visibilityOf(
  driver.findelement(filterCombobox)));
selectMovieOption();

Also Alan Richardson released a paid course about test automation on LinkedIn: Advanced Selenium: 3 Synchronization Strategies. If I need more tricks, I consider to have a close look.

My improved FAQ for test automation

Q: What to do, if I always have a No Such Element Exception?
A: There is a good chance, that the web element cannot be found. So my way for to locate the web element is bad. There are several ways to find a web element.

Q: What to do, if I always have a Stale Element Exception?
A: There is a high chance, that TestNG is used. The element to be used cannot be found any more. In this case I use a findElement as late as possible.  Another option is to add some additional steps like logging out and logging in.

Q: What to do, if I have a No Such Element Exception once in a while?
A: Use a FluentWait.

Q: What to do, if I have a Stale Element Exception once in a while?
A: See the answer on the previous question.

Q: Do you have anything to add?
A: Have a look at Deliberate Practice. I mean the way of learning and not the previous chapter.

Selenium, I think this is the beginning of a beautiful friendship.

Find The Button Sometimes In The Room

Small recap also known as cliff hanger

At the end of the sprint I demonstrated my automated regression tests. An unknown dialog popped up and interrupted the normal flow of the tests.

An unexpected dialog

After the demo one of my team mates asked the standard routine questions:
“Did you test before the demo?”
“Yes, of course”
“Did everything go right?”
“Yes”

I had done all the standard actions and still this dialog popped up. I studied it. Something went wrong with saving a file. This neat feature offered the user to add a personalised picture with a text like “Happy birthday, Cap. Loves from Dom, Sam, and George.” This way nicknames “Captain Marvel” or “Captain America” can be used or even abbreviated to Cap.

So the first attempt to save the file failed. I pressed the OK button to upload the picture again. After two other attempts, an error dialog popped up. It was not possible.

Of course I tried to reproduce this error manually, but all uploading went just fine. Hmm. Another attempt with the automated test showed the file upload problem straight away. The computer was too fast with testing.

The Need For Brakes

Imaginary scene in a shop in a cinema. I am recognised by one of the employees.

Employee: “Good evening, what do you want to drink?”
Me: “Well.”
Employee: “Here is your favourite drink, Cola.”
Me: “I was thinking about .. ”

Employee: “Here is your second favourite drink, Lemonade.”
Me: “Actually ….”
Employee: “This is the last drink we offer: Sparkling Orange.”

Me: “This was not in my mind.”
Employee: “You are going to watch Monsters Unlimited with the famous desert scene. Right?”
Me: [Nods]
Employee: “Excuse me for being so rude.”
Employee [Removes the 3 drinks from the counter and places a bucket on the counter.]
Employee: “This will take a few seconds.”
Employee: [Places a thick tube into the bucket.]
[The sound of 1 gallon of Sparkling Orange being pumped into the bucket.]
Employee [Removes the tube and smiles at me]

Me: “And …”
Employee: “You are going to the 5D experience with the real desert temperature.”
Me [Nods slightly]
Employee: [Empties a box of ice cubes into the bucket.]
[The sound of overflowing Sparkling Orange, followed by dripping sounds on the floor.]

Me: “I am trying to tell you …”
Employee: “I got it. Drinking out of a bucket is a drinking hazard, so you get this special straw.”
Employee [Pulls out a mini submarine with a tube on top and places it on the drink.]
[Again the sound of dripping Sparkling Orange on the floor]

Me; “I want ..”
Employee [Shows receipt of 100 Euro.]
Me: “nothing to drink.”
[The end]

This story describes a timing issue. The employee is way too fast. And guess what? Programs are also very fast. For example a test automation tool.

Wait a few seconds

Something had been changed in the program and a dialog popped up. There should be a way to let the test automation tool wait. I picked Thread.sleep(2000). This command let the tool wait for 2000 milliseconds or 2 seconds.

I started the tests again. This time no problems with the Error dialog were encountered.

Next stop was to ponder whether this was a proper solution. I was actually hiding a performance issue. My team lead had already given me a hint about this kind of cases.

Personally I never had any problems with the upload of the file. So this should not happen with other human beings. Waiting for 2 seconds was not that bad.

The Untouchable

On my screen I had a nice combo box. I wanted to select an option. This was not that difficult I thought.

My test failed. Wait, this cannot be true. All the time the combo box was in full view and my test automation tool Selenium web driver could find it until that very moment. I opened the console to look at the problem: it was a Stale Element Reference Exception.

On the internet I read about a situation that a web element was somehow disconnected with the element on the screen. This read quite cryptic. I tried to imagine what happened.

There was a combo box with movies to be shown, Monsters Unlimited and Finding Marlin. After the selection of a new date a new movie would be shown, the combo box was updated with the latest movie, Outside In.

What actually happens was that the old combo box was replaced by another combo box. So the old combo box did not exist anymore. Small courtesy of the low code development tool. Not really helpful.

But why did this error happen right now?
The code of the website was not changed. But. I had changed the structure of my tests.
How can a restructuring of my tests cause this problem? Give me a few paragraphs to explain.

A popular design pattern for test automation is the Page Object Model. A design pattern is an experience based way of working, which saves a lot of time and frustration. Using Page Object Model or POM I put all the old code associated with a page like Select Movie Page in one single class.

The class contains the following useful information:

  • Constructor (how can I make this page object?)
  • Methods (which actions can I do on this particular page?)
  • Fields (which web elements are contained on this page? What other relevant information is used by this page?)

A movie combo box can be coded like:

@FindBy(contains(@id, “moviesComboBox”))
WebElement moviesComboBox ;

This is an abbreviation of TestNG, a test framework, for

WebElement moviesComboBox = driver.findElement(By.xpath(contains(@id,“moviesComboBox”))

For the reader wondering about the word contains, there is an explanation about this construction.

What I set up, was an administration, which connects moviesComboBox to the movie combo box with the movies Monsters Unlimited and Finding Marlin on screen.
The program replaced the combo box with the two movies by the movie combo box with Monsters Unlimited, Finding Marlin, and Outside In.
Now my web element moviesComboBox was referencing nothing.

My solution was to make the connection between the web element moviesComboBox and the combo box on screen as last as possible. Just before selecting a movie I placed the following code:

WebElement moviesComboBox = driver.findElement(By.xpath(contains(@id,
                                     “moviesComboBox”));

I got a Stale Element Reference Exception. No worries, I use a sleep.

Thread.sleep(100);
WebElement moviesComboBox = driver.findElement(By.xpath(contains(@id,
                                     “moviesComboBox”));

This was a flaky test. I could tweak my number of milliseconds of sleep, but a reliable test was slipping out of my hands.

The Unfindable

Now I had a situation that in 60 % of the cases my tests would execute with Passed. This was quite disturbing for me, because the website was not changed. Same test, same unpredictable result.

I focused on my latest test automation challenge: finding the right order identity often abbreviated to order id. Users were allowed to use an order Name like “Cap 13”. This is short for the 13th birthday of Captain Marvel or Captain America.

But this could hurt the handling of orders. Suppose a parent of Cap had made two reservations with the same name. If this persons calls the cinema, which order must be deleted by the customer agent? Cap 13 or Cap 13? So an order id was introduced.

For test automation this was really helpful. The organizer or parent placed the order for the movie visit. And she or he got an order id. In turn all attendees or kids could use this order id to order a snack and a drink.

If I automated my manual steps, then everything would be okay.
My steps were:

  • Search for the order name.
  • Determine the first row in the table.
  • Determine the order id in this row.

The code was ready, but the test did not pass. Another fail on my record. I better got used to this.

This time I saw a No Such Element Exception in my console. This meant, that the first row could not be found. Then I got a déjà vu. The test automation tool was too fast, so I built in a sleep. This did not solve the problem completely.

Sent until accepted

Suppose there is a character, who wants to reach someone else. Let me pick an arbitrary person called M. McGonagall. Her employer does not receive a response on her letter.

So every responseless day she resends a letter and also slowly increases the number from 1 via 3 via 12 via 24 via 30 – 40 to some 100. Until a pink umbrella wielding bloke delivers the long awaited letter to Mr. H. Potter.

The Multiple

In the meantime I was tweaking my sleep time in milliseconds. It looks that a response time was between the 2 and 6 seconds. If I only used the worst case scenario time, then this would lead to an increased execution time of my regression tests. Because the low code tool automatically made the code for the website, there was no way to tweak this code.

I got an idea. What about trying to find the first row 3 times instead of once?

Boolean individualOrderNotFound = false;
For (int i = 0; i < 3 && !individualOrderNotFound; i++){
  try {
      findElement(xpath).click();
      individualOrderNotFound = true;
  }
  catch(NoSuchElementException e){
      Thread.sleep(2000);
  }
}

While blogging I fully realise that this is not the best piece of code to be shown. But things in the past cannot be changed.

I performed my test 5 times in a row. There was 1 fail. I felt relieved, that my tests were more reliable than before. Less fails on my record. I better got used to it.

There was still one more thing to check.

Time for another blog post.

Find The Button In The Room

Introduction

This is my second blog post in the Find In The Room blog post serie. In order to avoid any legal issues I sanitised my story. It is about software testing and IT: test automation.

For this story I will use the Cinema Hype VIP website.

Voice commercial:
“Are you tired to buy drinks and snacks for a child birthday party in a cinema?
Cinema Hype VIP website is here to rescue you.”
Author – that’s me: “Let me turn down the volume.”
[Presses a button]
Commercial [Loud voice] “Now you can order everything before setting a foot in the cinema.”
Me: “Excuse me. Let me mute the volume.”
[Presses a button]
Commercial: [Loud voice] “What are you waiting for?”

Me: [Surprised]
[Presses a button]
Commercial: [Silent]
Me: [Silently smiling]
[Presses a button]
Commercial: [Silent]
Me: “Test. 1 2 3. ”

Commercial: [Silent]
Me [Remains a few seconds silent.]
Commercial: [Silent]
Me [Looks a few lines up and down.]
Me [Remains a few seconds silent.]
Commercial: [Silent]
Me: “Ahum.”
Commercial: [Silent]
Me: “Someone is watching me from a few lines above.
Oh, I watched myself.”

The moment of approval

In my introduction I wrote several times about the button. It took me some effort to find the right button.

Now it is time for a real world test automation example. For my first big test automation experience I programmed the steps in Java. Selenium was used for the interaction with the website.

One of the most important steps of a website is pushing a button. These days a lot of deals are closed with a press of a button. Also online transactions need some key presses to pay. So I must be able to find a button on the web page.

Let me return to the Cinema hype VIP website.
My kid has a birthday party and all tickets, snacks, and drinks are listed. The only thing I have to do is to press a button.

The quickest way

Years ago I thought that there was one way to find a button.

  • Right click the button and select Inspect in the Option menu.
    An option  menu is shown above the OK button. The last menu option is Inspecteren or inspect in English!
  • Select the HTML code of the button and copy XPath.
    In DevTools  menu is shown above the HTML text for the OK button. This menu contains the sub menu Copy containing the option Copy XPath!
  • Give XPath to Selenium to find the button.
  • Pat myself on my shoulder.

Then my attention was drawn to the free online course of Andrew Knight, Web Element Locator Strategies, on Test Automation University.
So what did I actually use?

An XPath is basically a route description through the web page. And it can look a bit scary:
/html/body/div[2]/div/div[2]/button
This is of course automatically followed by Selenium. That is something programs tend to do. There is 1 huge problem. If signs change, then Selenium cannot find its way.

Let me use an arbitrary text on a letter and transform it to a more computer friendly notation.

/Surrey / Little Whinging / Privet Drive 4 \/The Cupboard under the Stairs / Mr. H. Potter.

If his uncle would move Mr. Potter to a bed room, then the postman had still no problem with delivery. Same address and a decent room this time.

Would it a bit more convenient to address the letter to a mister called H. Potter? A muggle postman would have serious problems, if this Mr. is evacuated to an island before his 12th anniversary. But finding him is a Half Giant job for a bloke like Hagrid.

This would lead to:
//Mr. H. Potter

But computers need more details:
//Human[contains(text() = 'Mr. H. Potter`]

Find a button with text OK.In that case I would get something like
//button[text()='OK']

The HTML code of the OK is hightlighted, while the search bar contains the text “//button[text()='OK']” followed by the text “1 of 1”!

Let me give you a more precise translation:

  • “//” means “Find somewhere on the page”
  • “button” means “the first button you encounter”
  • “[text()= ‘OK’]” means with the condition, that the text is equal to ‘OK’

No idea

But this does not completely explains:
/html/body/div[2]/div/div[2]/button

  • “/” means “search directly under”
    “body/div” means “search the first div under the body”
  • “[2]” means the second, so
    “div[2]” is the second div.
  • The rectangular brackes, “[” and “]”, are useful, if I do not need the first , but another one in the row.

The website I was testing was created with a low code tool. This tool can be compared with an advanced presentation tool, which also builds a fully functional website.

With great power comes great creativity. This basically means, that certain things were not fully under control of the developers. As a tester I had to solve these problems.

Placing a button on a web page led to an explosion of actions. Lots of code were automatically added, but this led to names like 1_saveFiles.

So I used ‘1_saveFiles’. A fellow tester pointed out, that the low code tool could change the button name to ‘2_saveFiles’ at will.

So I focused on the last part of the string.
//Button[contains(@name, 'saveFiles')]
This means such much as
“Search a button with the name containing saveFiles”
Of course there is a faster way to address an element using the attribute id. There is no magic needed to find Mr. Potter, if we were on the same page.
//Human[contains(@id, 'Mr. H. Potter`]

By the way id is pronounced as at Eye Dee instead of it. If you want to surprise your big sister or brother test automator, then use a sentence like “That element had probably no id.” Don’t forget a little sigh.

In my case id was not always set. To make things a little more challenging for me a single condition was not enough.

This is an exaggerated situation:
Code for dirnks: <input class="radio" name="2_drink" type="radio" value="one"> Cola</label> <br> <input class="radio" name="2_drink" type="radio" value="two"> Lemonade</label> <br> <input class="radio" name="2_drink" type="radio" value="three”> Sparkling Orange</label> <br>!

//input[contains(@name, 'drink')]
This might lead to some drink

//input[@value = 'two')]
could lead to the second drink or second snack.

So I chose for two conditions:
//input[contains(@name, 'drink')][@value = 'two']

There were other cool tricks in the course of Andrew Knight. The described ones in this blog post were big time savers.

Show and fail

It was time for the demo. My team liked that I would show my scripts in action. People were looking when I kicked off the tests.

An unexpected dialog popped up. I had to close it. What went wrong?

I apologised and left the stage. My team members postponed the demonstration of my tests.

Time for another blog post.

Find The Monster In The Room

One evening in the winter I was having a dinner. People enjoyed their meal and there was a lot of talk.

The mood
was good.

Then the youngest child shrieked of panic. All talk stopped.

The first steps would be like: go to the bedroom and put on the light.

Everyone at the dinner table looked at the kid a few meters away. The kid was in the same room.

The mother said that the kid had seen something. She went to the little child and tried to talk about it. This was difficult, because the kid knew only a few words.

The mother looked in the direction of the fearful eyes and saw nothing strange.

Back at the dinner table she told a story about curtains with triangles which looked like eyes to another little kid.

The second shriek was handled in the same way. The mother went to comfort the child. While looking for the source of fear.

The 3rd time an adult was with the frightened child within a second. The person lowered the head to the same height of the kid and looked carefully.

A machine showed some scrolling text. It was like the pupil of an eye looking for …

One of my kids asked: “Can I draw out the power cord?”
My answer was: “Yes.”
This was immediately followed by a familiar sound.
The display went blank.

Earlier that evening there was a power outage. The machine was switched on and had no current time. So it politely asked to set the proper time and scared a little child.

Some readers might remark, that this blog is about IT and  testing.
My answer is: “Yes”.

My New Year’s resolution is to Find The Monster In The Room.

Now I gave it a name.

My Workshop At Agile Testing Days 2019

Preparation costs energy

After all the last weeks’ changes I could finally start my actual workshop.

I felt an energy drop and watched an expectant audience from a far distance. I used my automatic pilot for the intro.

While nobody moved, my distance to the audience became closer while I was talking.

Boom.
I was back in the room.

First test session

For me the most elementary things of Exploratory Testing are

  • Charter
  • Test idea
  • Explore
  • Debrief

For this I created a heuristic. CTED is pronounced as See TED. If I need some inspirational talks, then I go to Ted.com.

A charter is a short instruction for a test session.

Explore < target >
with < resources >
to discover < information>

This template of Elisabeth Hendrickson is compact and informative. As mentioned in Explore it.

For the interested people test charter is not found in the index, charter is.

In my workshop the Target was a website. But it is still quite big. Resources is often a web browser.

Information was focused on privacy. General Data Protection Regulation or GDPR, an European privacy law, is still quite huge, so the next step was to select some articles of GDPR.

Ik picked 2. 1 lead to the following question:
Does the website ask consent to gather information?

A charter can be quite abstract. A test idea can be used to focus on a feature, window, or term used in the website to explore.

Consent is not frequently used, but which words are used in a web site?
Privacy, cookies, permission, private data, etcetera.

Using the charter and test ideas it is possible to explore the web site, whether consent is actually asked from the user.

During the debrief the attendees shared their information, which could be used for the following test session.

Background information first test session

For the basic structure of the test session I used the heuristic DiSSS from Tim Ferriss. This stands for Deconstruction Selection Sequence Stakes.
I assume that i was added for pronounciation reasons.

I looked to all the steps I took during Exploratory testing.
Are detailed test cases needed? Not in every case. Most of the times a good description of the precondition is good enough.

What I noticed during Deconstruction was that certain steps always came back. These steps I used for the Selection for CTED. This also led to a logical Sequence. The Stakes were twofold: people had to tell whether the workshop is worthwhile. Also the fines for privacy could be quite high.

Second test session

One test session done.
Another one to do.

At the beginning of the session I enhanced the resources with personas. For me a persona is a person with a need, who interacts with the system.

Examples for a need are: acceptance, cooperation , safety, purpose, learning, support, inclusion, etc.

E.g. a known persona is a marketeer. The more she or he knows about a website visitor, the more she or he will sell.
For this purpose I had made a set of persona cards.

I also handed out an one pager to the attendees with articles and test techniques which could be used for testing websites on GDPR compliancy.

The test techniques were selected using DiSSS.

After the Explore phase more issues were mentioned during the Debrief phase.

Background information second test session

Once again I used a heuristic of Tim Feriss, CaFE. This is an abbreviation for Compression Frequency Encryption. Once again I assume that ‘a’ was added for pronunciation.

Was it possible to compress information for testing GDPR? Yes, by making an one pager.

I tried to make to Frequency high, so attendees had to go through Charter – Test idea – Explore – Debrief cycle multiple times.
I used Encryption by using CTED.

In case you need more background information, please have a mind map.

What went wrong

The time to explore was quite short. I did this on purpose. For beginners it can be terrible to click through a site for 10 minutes on your own without finding anything.

In hindsight a group activity was better suited to explore the website.

While I tried to keep the introvert involved, it was a challenge to give them enough speaking time. I really liked the sticky notes for found bugs in the workshop of Lisa Crispin and Lena Pejgan.

My prerequisite for the workshop for a laptop was not needed. I could demo certain tools using my own laptop. Luckily there was an Open Space to demonstrate GDPR and Exploratory Testing.

What went right

The demo was a great way to change the pace of the workshop. I had good feedback during the repetitions

My impression was, that most attendees were hesitant to test their own websites or websites of their employers. My test website provided a safe environment to explore.

During the preparations I learned a lot about websites and tools.

Thank you José Diaz and your team for this wonderful journey.

Tweaking My Workshop Accessibility

During the Speakers Dinner of Agile Testing Days 2019 I told Abby Bangser about my attempts to make my workshop accessible.
“It is even possible to add alternative text to images in PowerPoint. If you click on the image, there are several tabs. One tab contains Alternative text. [ … ]

Don’t forget the exclamation mark (!). The screen reader will read it differently.”

Tobias Geyer, another speaker, was confused. I saw him thinking: “Alternative to what?”
I told him about a screen reader which could read information aloud to people. This is handy for people with a visual impairment. Alternative text is used on web sites to add more information to pictures.

If the presentation would be downloadable at the beginning of the presentation, then attendees would be able to hear the information on the slides.

Blind review

Some people state that a blind review is the best one. The reviewer is not distracted by the looks of the speaker or the beauty of the pictures.

One of my reviewers was blind, so I really needed to speak well. Without the use of my slides it was difficult to tell a story. The main feedback was no clear structure.

So I added a mind map which gave a proper view of the workshop. This was really appreciated by the next reviewer.

For the exercises I had already tested the website with a screen reader. Once again it was time for the real thing.

My blind reviewer went through the website without any delay. The reading speed was so high, that it looked like a normal person was skimming the webpages. The feedback was almost instantaneous.

It was strange for me to hear, that bugs were found by clicking around. Navigation was on hearing. My test website passed the accessibility test.

Sound advice

The Friday before Agile Testing Days I had a talk with someone with a bad hearing. I told about my workshop. How should I speak to people who cannot hear well?

“What would be your best advice?”
“Ask whether people can hear you.
It is a professional thing you can do:
“Can you hear me?”

What also helpful is, are pictures. Next to key words on the slides.” This way a talk could be reconstructed, if words would be missed.

Somehow I lost sight on my slides.

I told about the handheld microphones seen on one of the pictures. Most of the time I put it in front of my mouth.
“It can be lowered. The quality will not decrease much, but people are able to see your mouth.” Lip reading for the win.

In the days before the workshop I focused on big fonts on my slides and my cards. I increased the contrast between the text and the background.

What could go wrong?

What went wrong?

I completely forgot to ask the audience whether they could hear me. Where was my checklist?
I had none.
Oh.

The most embarrassing part of the downloadable stuff was, that there were no files on the promised location at the start of my workshop.
Big oops from my side.

After this painful discovery I repeated all the steps: I went to my github and uploaded my presentation. This time I scrolled down. A commit button?! I forgot to press it.

Github is git in the cloud. It can be used to store different versions of files. I still wrestle with it. As Janet Gregory stated in her talk it is about deliberate practice. I had only practiced once. In my case I had cut one corner too many.

Days after my workshop I checked the alternative text in the pdf file of my presentation on my laptop. I double clicked the file and the file was opened in my browser.

The text of the slide was told aloud by the screen reader. I hovered above a picture. Not a sound. I was also silent.

Last weekend I did another attempt to get some sound of a picture. I double clicked the file on my PC and Acrobat reader opened the file.

I searched a picture and placed my mouse pointer on it. A hover text was shown and read aloud. That’s what I liked to hear.

So Acrobat reader can handle alternative text of pictures, but my favourite browser not. And I had not made Acrobat reader a requisite for the workshop. A bit late, but alternative text can be used.

What went right?

I maximised pictures. Leaving out irrelevant parts from the slides.

In the right top corner of the slides I used small pictures to show the state of the test session.

During my preparation I looked at the presentation. There were no spots shining on the screen, so the contrast was good.

During the demo part I used a headset microphone. Attendees could hear me and I could talk at a normal volume. Most important is the fact, that the small microphone did not hide my mouth.

Warning: Code of Conduct ahead

On November 5th I gave a workshop about Exploratory Testing and General Data Protection Regulation. GDPR is an European privacy law.

Need

In the past I wrote about the Code of Conduct. A good set of rules will ensure the safety of the delegates, the speakers, and the organisers of a conference. When enforced.

Therefore I was keen to adhere to this Code. The more diverse people at a conference, the more perspectives being shared. A new perspective is not always out of the box thinking, but natural for some people.

A woman looks different to privacy than a man.

Now I had a dilemma: I had a workshop about privacy. If a name and address would become public, then unpleasant things could happen to certain people.

I remembered a conversation with a white man not realising the consequences of a data breach. So I shared a story with him. It had some impact on him.

But this same trick would have a bad impact on women present in my workshop. So I would not stick to the Code of Conduct.

Imagine being removed from the conference as a speaker. Not good. At all.

Contact

It was time for me to mail to Uwe Gelfrich, my contact at the conference. I made a brutal honest warning like:
the workshop contains situations about violence and harassment.

In this way I could still talk about certain situations. Because people were warned in advance.

Uwe replied thoughtfully: violence and harassment would not be used in the workshop. And he proposed a warning along the following lines:
the workshop may contain situations about violence and harassment.

I agreed.
The warning was set on my abstract on the website.

And I would not use a rant.

Attention

During the preparation of my workshop I read a tweet about an anxiety attack of a delegate on a conference. According to me this person was angered about the vague content warning.

I reacted with the following tweet:
“During Global Diversity CFP Day this year I heard about trigger warnings for the first time.

So I did my homework.

I contacted the conference about a suitable and specific warning. It is on my abstract. It will be shown before and right after the start. I will tell it.”

Start

On the day of my workshop I tweeted about the warning. It was retweeted by Agile Testing Days.

During the arrival of the delegates I regularly switched between the workshop title slide and the warning slide.

After the opening I gave a warning and an explicit permission to leave the room. I would not be offended. Then I waited about 20 seconds before continuing.

So this looked like an inclusive opening of my workshop.

Actually no.
I missed some accessibility items which will be covered in the next blog post. Reads like a pretty cliff-hanger.

Change

On the Women and Allies evening a delegate told about a talk with HR. If colleagues would not behave themselves, then they would probably be removed from conferences because of the Code of Conduct.

Bonus Workshop Preparation Stage

Some thoughts:
“Are you really ready for your Agile Testing Days workshop?”
“No. Slides need to be updated. There are concept handouts. I still need to tweak.”
“So what is that bonus stage?”

Dreadful stage

The Bonus Workshop Preparation sSage starts after the dreadful stage, the stage without progress.

Progress can be measured in number of sheets or number of the exercises. I prefer the number of usable ideas for attendees. Customer centric. Sounds Agile to me.

2 weeks before my holiday I was in the dreadful stage. One of my website exercises became smaller instead of bigger. I used all tricks to get a baseline, but I failed.

I realised that I had to step back. The only solution I had was to fall back on an older version of the software. Within a few days I had a better solution.

Bonus stage

Another way to determine the bonus stage is the feedback of my reviewers.

My basic question: were they engaged?
My observation: yes.

I paid attention to words and the way they were pronounced. I looked at the body language. Most important: did they learn something?

What would I more include in my workshop?

  • an one pager
  • list of extra resources
  • a mind map
  • visual clues for exercises

“You can always change your workshop.”
My wife

Proper stage name

Last weekend I talked about my workshop with one of my kids. I told that one reviewer and I missed an obvious bug in the website. I was amused.

I told about some jokes how to illustrate my points. We had a good laugh about it.

The bonus part is also the fun part. The part which will make a workshop good or great.

Workshop Mind Maps

Can I make a mind map for a 2  hour workshop?
Nope.

First set

Over a few months I have to give a long workshop about European privacy laws and Exploratory Testing. Sometimes it is tempting to put all the information in one extra extra extra large mind map.

Giving me a disappointing delay in processing information.
Forget it.

Wait. I use several mind maps.

Yes. That is more comfortable.

In this blog post I will show titles of mind maps to prepare myself for my workshop at Agile Testing Days.

It took me months to make these mind maps. This is my way to collect more information than I would be able to share.

This gives me enough space to tailor the workshop on the spot.
Did you ever tried to entertain people for 20 minutes?
I will have to teach people for 2 hours.
Good luck. To me.

Why do I share information about my mind maps?
It will give the delegates some hints what I will tell.
I also want to share my preparation with newbie speakers.

Another reason is to attract more diverse speakers on stage. Preparations is like taking small steps.

There are even sessions for speaking at the same conference.

So what are you waiting for?

In order to avoid boredom I just select a few mind maps for a small introduction.

T
There is no way to predict the people in my audience. So I made a lot of categories. Next to the beginners, I have exercises for experienced testers, testers using tools, and managers.

An experienced tester knows what a dataflow test is. Now I also have to explain this to a manager. But I come back later to DiSSS.

Second set

The framework of my workshop is in the  file ‘Talk Lawful Thing to test 1c’. If this sounds strange to you, I completely understand you. It started as a talk and grew to a workshop.

After a while I could not add new perspectives. So I made some other mind maps.

Resources are things you can use after my workshop. This part seems relatively simple. I only had to put in some good resources in it. I made this exercise challenging for myself by adding information written by women.

A good opening or intro of the workshop sets the atmosphere for the coming hours. If I will casually tell something to complete strangers at the beginning of the workshop, it is because I rehearsed it more than 100 times.

Up till now I could not find a shortcut.
Rinse and repeat.

Third set

Tim Ferris has a never ending serie of experiments.

Yes, I made a typo in the file name. And for me it is about speed.

A mind map with central object Lawful thing – Ferris which has branches DiSSS, Jokes, and CaFE. The branch DiSSS has sub branches Deconstruct, Selection, Sequence, and Stakes. The sub branch café has sub branches  Compression, Frequency, and Encoding.

Tim developed some acronyms like DiSSS.

  • Deconstruction is the first action to understand how people perform tasks.
  • Selection is the second task to select which techniques have the most impact.
  • Sequence: what is the best order of actions?
  • Stakes: what’s in it for me?

CaFE

  • Compression: how can I compress the information on 1 page?
  • Frequency: how often should I do it to become good?
  • Encoding: what is a good way to encode the information? Like CaFE.

Is it possible to use these acronyms for GDPR testing?
I think so.
The dataflow test is a good candidate for Selection.
I wrote you I would come back to DiSSS.

The first test session needs extra attention from my side.
During my workshop there are several sessions during which delegates are going to test. Hands on is different from watching. It is like a tennis game with everyone on the tennis court.
And I am the referee.

The mind map ‘20190528 add Lawful thing’ contains information I still need to process.

A workshop is like work.

Speaking matters

In this blog post I share my latest progress on my speaking.
One of my reasons is to get more diverse speakers on stage.

The making and the scale of my mind maps might intimidate newbie speakers.

What I left out, is my adding of nodes in the mind maps over time. This could be days apart.

What I left out, is the long study.
If I add 1 branch to a mind map every day, I have a mind map of 365 branches after a year. I started in the summer of 2018.

If I go in more details, the more branches I will add on a single day.

A talk takes time.