Tuesday, April 19, 2011

Selenium Tip - Using Regular Expressions

This comes straight out of the LMN Selenium classes we offer. A tip to help you find html elements that have the same series of letters in them. This is a small screen shot from one of the applications we built to filter news articles for us, determine the location and put it on a map.

Notice the two rows that have the letters bomb. How would you verify the existence of each element?


<a target="_blank" href="http://news.google.com/news/url?fd=R&amp;sa=T&amp;url=http%3A%2F%2Fwww.topnews.in%2Fsuicide-bombing-iraqi-football-stadium-2261845&amp;usg=AFQjCNGt7-LevFBRrBlwKot-8QL5ymhpOA">Suicide bombing at Iraqi football stadium - TopNews</a>
<a target="_blank" href="http://news.google.com/news/url?fd=R&amp;sa=T&amp;url=http%3A%2F%2Fwww.abc.net.au%2Fnews%2Fstories%2F2010%2F05%2F15%2F2900299.htm%3Fsection%3Dworld&amp;usg=AFQjCNG9SJlQwiS55Jv77lp8Nb5OhVwOaQ">Deadly bomb blast hits packed football stadium - ABC Online</a>

Find the link with the word bombing and then the one with the word bomb.

Selenium IDE:

Command
Target
Value
verifyElementPresent
css=a:contains(“bomb”)
verifyElementPresent
css=a:contains(“^bomb$”)


Selenium RC - jUnit
verifyTrue(selenium.isElementPresent("css=a:contains(‘^bomb$’)"));

The ^ means start with. The $ means ends with. This is called regular expression language. This combination of caret bomb dollar sign is the compete expression and will find the exact word bomb.

For more information, questions or topics you would like to see here e-mail us.


Monday, April 18, 2011

Automated Testing with Selenium Training

Automated Testing with Selenium Training

Last month we started teaching a class on Selenium IDE and Selenium Remote Control. Watch this blog for upcoming announcements for more classes. The class is hosted in Reston, Virginia.

It has been a pleasure to teach others what I know about Selenium. We hope to blog more on Selenium testing tips in the near future.

Within fast moving agile software development teams it becomes important to test user interfaces as they are being coded. Automated Testing techniques using Selenium allow for test replay of important features as development progresses.
Selenium IDE and Selenium Remote Control are important tools for any tester and even developer to use in ensuring software quality and consistency. This interactive hands-on workshop provides an understanding and advanced techniques in the use of Selenium with hands on practice. The practice exercises are tailored to various skill levels and type of application being tested, from simple forms to Ozone Widget Framework applications.

Using presentations, guided configuration and automated test plans, the class teaches:
• Understand trade-offs of automated vs. manual testing.
• Record, edit and play back Selenium IDE tests against multiple types of web applications.
• Minimize test failure due to normal changes to code.
• Understanding of basic Selenium commands to get through common issues with web applications
• Move tests from IDE to Selenium RC.
• Use of Eclipse to run tests individually and as a group to generate test failure reports
• Understand the importance of making applications more testable to improve usability.

Topics
• Overview of automated testing
• Selenium IDE
• HTML Locator strategy
• Firefox Firebug
• Selenium Remote Control setup
• Eclipse and jUnit
• Moving IDE tests to Selenium RC
• Selenium RC practice workshop.
• Learn how to test in multiple browsers and generate metrics and reports.
• Discussion of setting up Selenium RC for continuous integration

Bonus Features
• Sample Selenium RC code
• Scripts to run jUnit suite tests on multiple browsers and generate reports and metrics.
• List of web resources and blogs for reference.
• CSS locator cheat sheet.

If you want to come to the class or have a question e-mail us.





LMN Solutions - Find out more about us.
info@lmnsolutions.com

Sunday, April 17, 2011

Please Test Everything

Please Test Everything


Let me welcome you to this blog about software testing. We hope to share our knowledge of software testing with you. This blog comes out of a class we host at LMN Solutions called Selenium Workshop for Testers. We hope to post information here that will aid those who have taken the class.

The title of the blog is aspirational and often sums up the wish of those who rely on the software tester to make sure applications work correctly. In addition we hope to cover the breadth of software testing; ranging from automated, performance, unit, functional, integration, web, mobile, imagery to any new forms of testing we learn about on the way. Some of the things we will cover around testing are Java, jUnit, Selenium, Watir, Cucumber, Ruby on Rails, Fitnesse, MarkLogic, GIS, Imagery testing and more.

Please subscribe and get ready for some testing tips, tricks and hacks.

Please contact us with any topics that would be of interest. lmn-testing@lmnsolutions.com

www.lmnsolutions.com