Selenium Test, Distilled Version

Rummaging over some old Java test code yesterday, refactoring to change project name, clean up dependencies and such, in order to create a nice clean demonstrable Selenium WebDriver test sample.  After tinkering with various helper Java classes – and fixing dependencies and code breakage – realized the test did not actually do what I needed yet.  Too much time spent tinkering, not enough time spent actually doing.  Common problem.

Decided to try the bottom-up approach.  Was wondering how long it would take to build a working test from scratch, since I haven’t done that for a few years.  As it turns out, not too long at all… fifteen minutes, maybe less if you type faster than I do.

There’s plenty of sample Selenium code out there – Google search proves that quickly and nicely – but I wanted to re-cement some of the key steps in my head.  So, after picking someone else’s nice clean example, I then distilled some reference notes – in case my brain decides not to remember the basics at some point in the near future (because that never happens… :P)

Sharing in case someone finds them useful, or enlightening.  To learn more, check out the original example on SeleniumEasy.com, at the link shown below.

(Very) Minimal Java / Selenium Test

  • Create Maven project
  • In Maven pom.xml file, add dependencies for testng, selenium-java
  • In Maven pom.xml file, add plugin entries for maven-surefire-plugin, maven-compiler-plugin
  • In Maven pom.xml file, add suiteXmlFiles entry in surefire, point to testng.xml file
  • Create Java Test Class with:
  • — Imports: org.openqa.selenium (WebDriver, FirefoxDriver) and org.testng (Assert, Test, BeforeClass, AfterClass)
  • — @BeforeClass – setup, instantiate WebDriver
  • — @Test – navigate to URL, perform Assert test
  • — @AfterClass – teardown, quit WebDriver
  • Create testng.xml file to specify suites, tests, classes
  • Compile and/or update dependencies as needed
  • Execute via mvn test

Notes:
Remember to match Selenium versions with supported Browser versions

Mostly distilled from: SeleniumEasy.com
http://www.seleniumeasy.com/maven-tutorials/how-to-execute-selenium-webdriver-testng-xml-using-maven

 

Advertisements
Posted in Uncategorized | Leave a comment

Framework of Reference

Job-hunting recently.  Over the last few weeks, have noted that the term “framework” has been thrown into job descriptions, phone screens, and interviews with regularity.  However, not everyone seems to agree on what “framework” means.  For me, the tricky part is understanding what “framework” means to the person I’m speaking with.

For some, “framework” means the buttressing around test code.  This would include such software as jUnit, TestNG, or Arquillian.  These tend to make your test code easier to manage as “tests”.

For others, “framework” means an encapsulating application which controls and manages test (and/or build) code.  This might mean something like Jenkins, Hudson, or Bamboo.

Still others have their code or project management in mind when it comes to frameworks:  Maven, Git, Subversion, Rake…

And then there’s the Selenium crowd – that group which believes Selenium is not only a framework, but the answer to all things testing.  You’ve likely met a few of these people…

Okay, enough with the buzzword bingo.  I’m not saying any of this is wrong, and it’s certainly not a complete picture.  Just bear in mind – the light at the end of the tunnel might be an oncoming train.. or it might be someone’s idea of a framework this week.

Posted in Uncategorized | Leave a comment

Observer Effect

The “Observer Effect” – in physics and other disciplines – refers to the impact on a system caused by observation and measurement.  The act of measurement itself affects the system under observation, or if the system involves people, their actions are affected by their realization of measurement and observation. 

It’s become abundantly clear that far too often, the so-called “discipline” of software development and management is so impacted on both counts.

Thank you very much, Mr. Hawthorne.

Posted in Uncategorized | Leave a comment

Suits From Upstairs

Those of us who work on the building’s ground floor have some advantages.  Shorter walking distance from parking lot, easier access to fresh air for short breaks, and for the most part a more relaxed dress code.  We don’t interact much with live customers or the suits from upstairs.  Sometimes the different work cultures don’t mix well.  Especially when you encounter the ones that seem to treat everyone else without suits as invisible.  Granted, there are many inconsiderate people in the world, but add arrogance and entitlement to that mix and you get a particular irritating mix of person to avoid.  

And, to be honest, that suits me just fine.

Posted in Uncategorized | Leave a comment

When Innovation Calls…

It had been quite a while since last I had been to this part of the building. Nestled into a forgotten corner by the health center, the unlabeled door in the short hallway sought no attention from me or any other. I might otherwise have passed by, thinking it no consequence, had this door – and the room behind it – not been my intended and requested destination. Inside that room, I knew, a group of distinctive people waited.

I’d heard of them before, of course; a rumored cadre of exceptionally Innovative individuals. Not the “core” team, per se – with them, I was well acquainted – but those persons who were the true heart of Innovation. My thrill at meeting them, though, was tempered by a feeling of unease; a sense of something not right. I dismissed the notion, though, as simple anxiety over the lost time; I would have preferred to be working on my own Innovation projects, all long overdue for continued work, rather than ranging out on what was likely an unneeded fact-finding tour.

Reaching the closed door, I knocked. A pattern of lights – bars of color, with symbols of unknown import embedded – was projected upon the door. “You’re expected. The Mediator welcomes you,” a female voice spoke from mid-air, in the area of the pattern. Within the wall, an unseen mechanism recalled the latch; the door withdrew and allowed me to enter. As I did so, the projection traversed the wall beside me, and then appeared to float through the air, guiding me as I stepped into the room.

I saw four persons, seated at a wooden table. Dressed in non-descript garb – typical of their positions, and signifying their status as knowledge workers – they nonetheless carried themselves with dignity, their eyes narrowed with intensity, focused with intellect. But their presence was somehow vague, uncertain; it was almost as if they were both here and elsewhere, at the same time. That dichotomy visibly strained them; but their need to be heard, at this moment, was clear as well.

“Be welcome here,” continued the disembodied voice from the pattern, sparkling lightly. “As Mediator, I speak for all those who cannot, or will not. The ideas and thoughts of those Unpresent remain, for consideration by all. Those who are here, however, first would speak with you.”

At the table, a woman rose. “My name is Two,” she began, “and I am an Innovator.”

“Welcome, Two” chorused the others.

“I have been an Innovator for two years. In that time, I have created many ideas. But I am incomplete. My ideas languish, for though they have value, none will adopt them, and I cannot.” She paused, then reseated herself.

A man was next. “My name is Four,” he spoke. “I am an Innovator as well.”

“Welcome, Four” came the intonation.

“I have been an Innovator for several months now. In that time, I have created many ideas. But I am incomplete. My ideas have value, but are unfocused, having no end state, and thus will never be completed. No one will know…” His speech trailed off, fading.

Another man followed, quickly standing as his predecessor sat. “Three. My name is Three – and I am an Innovator.” Cutting off the group’s welcome, he continued. “And I am incomplete as well. My ideas are many – too many by some accounts – but they bear the echoes of previous ideas; some complete, some not. It is difficult to know when my ideas have value.” He gathered himself, and then slowly returned to his chair, gesturing to the next.

The last, again a woman, rose and continued without delay. “I am One, and I am an Innovator.”

“Welcome, One,” I found myself answering, as the rest of the group concurred.

“I have been an Innovator since the Beginning. My ideas are true, and complete. But I find they are neglected; they must grow, and be cared for, so that they may continue their purpose.” She glanced down the table, finding quiet nods of agreement from her colleagues, but remained standing. Slowly, she turned her gaze back to the image of the Mediator, now projected upon the surface of the table. “It is done, then?” she ventured.

“Yes,” confirmed the Mediator. “We shall continue, and prevail. Innovation is life.”

“So what happens now?” I interrupted. “You have some problems with Innovation, I can tell. I’ve encountered many of them myself. Do you think I can help you solve them?”

“You don’t understand,” the Mediator voiced softly, almost regretfully. “Perhaps you can. However, we did not ask you here to provide aid, but to receive it; for you belong here, with us.” At the end of the table, an empty chair now waited, where none had been before.

At that moment, I realized my error – and that they were right. Casting a brief glance behind, I saw the door – still there, still open, but holding no real hope for escape. The calling of Innovation was my own, personal success – and personal failing. In the crush of Time, I might lose my way toward Innovation as my own projects languished, unsustained. Together, these people would help restore that focus, even as I might help them on their own paths. Already, the first four again drew together to confer, weighing the fruits of Innovation, and anticipating the next who would step through the door.

I sat down in the last chair.

Posted in Uncategorized | Leave a comment

Things I Learned Seeing Blue Man Group

The Tremont Street parking garage near Citi Center, though expensive, is probably the most convenient to the Charles Playhouse.  There’s an alley connecting the two streets, and the streets are much smaller than they appear on GMaps.

The Charles Playhouse also is much smaller than it appears online.  For the seating, think cozy; for the halls, stairs and bathrooms, think cozier.

Blue Man Group’s current act is well worth the price of admission, though not overly long (1-3/4 hrs). Lots and lots of audience interaction.

The Poncho Zone is more of a precaution than a likelihood vis-a-vis projectiles.

Pureed banana, however, can be propelled an impressively long distance.

Many dire warnings were given re photography in the theatre.  Unfortunately, the kid across from us who videotaped the whole show with his mini camcorder didn’t get caught.

Posted in Uncategorized | Leave a comment

Setting the Bugs Free

I was late to work this morning, because I was helping the environment.  Or maintaining work-life balance.  Well, both, actually.

For the last week, our daughter Kaia has been monitoring her ladybug pupas as they exit their final stage, becoming adults.  We’ve been through this experiment previously – with butterflies – and Kaia knows that once they’re mature, the adult bugs need to be released so that before they die, they can eat some aphids and make some more ladybugs (hopefully anyway).  So, we’ve been awaiting the time to let them go, in the cool of the morning so they’re more likely to stay in our garden (and eat OUR aphids).

Today was the day.  We took a few last pictures, brought the container into the garden and popped it open.  Kaia and I were both thrilled to see the ladybugs, newly exposed to the sunshine and fresh air, perk up and begin scurrying excitedly.  Crawling off their plastic former home onto our hands, the stones of the garden, and the leaves of the cucumber and bean plants, the ladybugs quickly vanished into the greenery.

You could almost sense their little bug brains thinking, “I smell PLANTS!”  Or maybe, channeling a bug-sized William Wallace, “Freedom!”  They might have been perfectly content in their plastic container, with safety, food, water, and a little girl who cared for them and adored their every development… but given the opportunity, the ladybugs were no less than eager to escape into the wild.

On a completely unrelated note – next week, our eldest son Alex joins many other newly minted adults in going off to college.  Just saying.  We might tell him to mind the bees and spiders…

Posted in Uncategorized | Leave a comment