Monday, September 10, 2007
WebTest Screencast: New cast on its way...
I'll try to bring the cast online till end of the week, or at least a first beta version :) As soon as I have it published, I'll post a new blog entry.
Regards,
Tomi
Wednesday, August 22, 2007
WebTest Screencast: Creating a first WebTest project
Marc Guillemot (http://mguillem.wordpress.com/) and myself are working on some screencasts to show WebTest capabilities. The first screencast has been announced on the WebTest mailing list:
and can be found here:
We are looking forward to publish a couple more screencasts within the next few months. If there are special features you would like to see in the upcoming screencast, let me know :)
Enjoy!
Regards,
Tomi
Wednesday, August 08, 2007
Dealing with critics?
There is an interesting post on Marc Guillemot's blog:
He's blog entry can be understood in a way, that the lack of XPath can be associated to the lack of test automation experience. If this relation is correct or not is not as interesting as the reaction which has raised based on his entry.
I'm very surprised, how personal this was taken, especially the comment of Neil: http://mguillem.wordpress.com/2007/07/31/xpath-power-2-detect-lack-of-experience/#comment-16. I would have expected more distance to such a statement and more tolerance.
My understanding of Marc's statement is, that the better an XPath expression is (better in the sense of robust), the better the tests are which might be based on the XPath expression. The first XPath statement Marc is quoting:
/html/body/table[2]/tbody/tr/td[2]/table[2]/tbody/tr/td/div/ul[1]/li[4]
from http://agiletesting.blogspot.com/2006/01/useful-tools-for-writing-selenium.html
is not robust at all. If there a small change in the used tables or additional items in the lists, the test will break. If there is a relationship between robust and better, that this statement is not prefered and in this sense, I can understand the statement of Marc very well.
Regards,
Tomi
Thursday, August 02, 2007
Groovy & OpenOffice?
There are some blog posts about Groovy as an extension within OpenOffice. It's quite interesting to read...
- http://www.ifcx.org/wiki/GroovyForOpenOffice.html
- http://wiki.services.openoffice.org/wiki/Extensions
- http://www.infoq.com/news/2007/07/groovy-in-OpenOffice
- http://lifehacker.com/software/windows/record-macros-in-openoffice-with-groovy-280472.php
Enjoy :)
Regards,
Tomi
Post on TheServerSide about HTMLUnit
I posted a small note on TheServerSide (http://www.theserverside.com/news/thread.tss?thread_id=46374) about the new features of HTMLUnit.
Regards,
Tomi
Wednesday, December 20, 2006
Groovy in Action
URL:
http://groovy.canoo.com/gina
Description:
Groovy in Action is a comprehensive description of the Groovy programming language, its libraries, and its everyday use. With the release of JSR 241, Groovy has become the second standard language for the Java platform. The book introduces Java developers to the new dynamic features that Groovy brings to this platform.
Enjoy!
Groovy in Action
URL:
http://groovy.canoo.com/gina
Description:
Groovy in Action is a comprehensive description of the Groovy programming language, its libraries, and its everyday use. With the release of JSR 241, Groovy has become the second standard language for the Java platform. The book introduces Java developers to the new dynamic features that Groovy brings to this platform.
Enjoy!
Monday, September 25, 2006
groovy articles on del.icio.us
Since I'm using Groovy in the current project (thanks to Dierk and Marc) I'll start collect articles about groovy...
This might help some other beginners to start with a steeper learning curve as well :)Enjoy!Read more at del.icio.us/TomiSchuetz...
Monday, August 28, 2006
Groovy: Parsing an XML file with Groovy
Currently I'm working with WebTest (http://webtest.canoo.com/) for testing functional aspects of an web application.
WebTest comes with a nice overview to present the results of the test runs. The report itself is transformed out of an XML file. For statistics reason, I'm using this XML file to extract specific data. This extraction is done with a little Groovy script.
To get an idea of the WebTest report XML file, have a look a the fragment below:
WebTestReport.xml:
...
name="resultFilename" value="response_1156746643278_invoke.html"/>
...
This file can be parsed with the following code:
import java.text.SimpleDateFormat
FormatUS = new SimpleDateFormat('EEE MMM dd hh:mm:ss z yyyy', Locale.US)
FormatDE = new SimpleDateFormat('dd.MM.yyyy hh:mm:ss', Locale.GERMAN)
def folder = args?.size() ? args[0] : "data"
println "reading files from directory '$folder'"
def basedir = new File(folder)
// result files of the current run
files = basedir.listFiles().grep(~/.*xml$/)
List resultLines() {
List result = []
for (currentFile in files) {
println " processing $currentFile"
def summary = new XmlParser().parse(currentFile)
// List with all 'testresult' elements
def testresults = summary.testresult
testresults.each { testcase ->
def entry = [:]
entry.name = testcase.'@testspecname'.split(/\W/)[0]
entry.time = testcase.'@starttime'
entry.time = FormatUS.parse(entry.time)
entry.time = FormatDE.format(entry.time)
entry.ok = testcase.'@successful'
def rt = testcase.depthFirst().findAll { element ->
if (element.name() != 'parameter') return false
if (element.'@name' != 'taskName') return false
def roundtripTags = 'clickLink clickButton clickElement'
roundtripTags.tokenize().contains(element.'@value')
}
entry.roundtrips = rt.size()
def fields = testcase.depthFirst().findAll { element ->
if (element.name() != 'parameter') return false
if (element.'@name' != 'taskName') return false
def fieldsTags = 'selectForm setCheckbox setFileField setInputField setRadioButton'
fieldsTags.tokenize().contains(element.'@value')
}
entry.fields = fields.size()
def verifies = testcase.depthFirst().findAll { element ->
if (element.name() != 'parameter') return false
if (element.'@name' != 'taskName') return false
def fieldsTags = 'verifyCheckbox verifyCookie verifyDocumentURL verifyElement'
fieldsTags.tokenize().contains(element.'@value')
}
entry.verifies = verifies.size()
if (testcase.results.error) {
entry.resultsError = testcase.results.error.'@exception'[0]
} else {
entry.resultsError = ''
}
/*
if (testcase.results.failure) {
entry.resultsFailure = testcase.results.failure.'@message'[0].replaceAll(/\W/, " ")
println "####" + entry.resultsFailure
} else {
entry.resultsFailure = ''
}
*/
def groupSteps = testcase.results.step.findAll { step ->
step.parameter.any { param ->
param.'@name' == 'taskName' && param.'@value' == 'group'
}
}
def goodSteps = groupSteps.findAll{ it.result?.completed }
// assumed: there is always at least one group step, size() never 0
if (groupSteps.size() != 0) {
entry.complete_pct = goodSteps.size() / groupSteps.size()
} else {
entry.complete_pct = 0
}
if (goodSteps) {
entry.description = goodSteps[-1].parameter.findAll{it.'@name'=='description'}.'@value'[0]
} else {
entry.description = ''
}
result <<>
writer <<
"Testfall\t" <<
"Datum\t" <<
"Erfolgreich\t" <<
"Prozent\t" <<
"Error\t" <<
"Server Roundtrips\t" <<
"Number of Fields\t" <<
"Verifications\t" <<
"Beschreibung\n"
for (entry in resultLines()) {
writer <<
entry.name << "\t" <<
entry.time << "\t" <<
entry.ok << "\t" <<
entry.complete_pct << "\t" <<
entry.resultsError << "\t" <<
entry.roundtrips << "\t" <<
entry.fields << "\t" <<
entry.verifies << "\t" <<
entry.description << "\n"
}
}
Now you get a tab seperated file with the content of your result files from the web testing runs. I
import this file into Excel and create a pivot table to understand the results better.
I hope this helps :)
Friday, August 25, 2006
Groovy: Get all XML files from a directory tree
Below you can see a nice solution for finding all XML files in a directory tree:
// pass a directory or use the current directory
def folder = args?.size() ? args[0] : "."
println "reading files from directory '$folder'"
def basedir = new File(folder)
// result files of the current run
files = basedir.listFiles().grep(~/.*xml$/)
List resultLines() {
List result = []
for (currentFile in files) {
println " processing $currentFile"
}
return result
}
Monday, August 14, 2006
GWT Widget Library
Google released a new version of GWT today, version 1.1.0. There were some API changes made that broke a few things in the GWT-WL, namely the FormPanel and SVG support. This release is to make the GWT-WL compatible with the latest GWT release. Below are a list of changes...
[from the site]
Read more at gwt-widget.sourceforge....
Friday, August 11, 2006
Eclipse Summit Europe 2006
Read more at www.eclipsecon.org/summ...
Eclipse 3.3 M1 - New and Noteworthy
It's amazing, how fast the Eclipse people work! Thanks to all of them :)
Read more at download.eclipse.org/ec...
Tuesday, August 08, 2006
Lint4j Maven Plugin - Lint4j
Lint4j comes with a Maven Plugin that simplifies generation of reports significantly.
I'll have to check this plugin with WebTestClipse ...
Read more at www.jutils.com/maven-pl...
dzone.com
An interesting site for developers. It's similar to del.icio.us and stumbleupon , but more focused on developers.
I like these community driven sites, because it allows me to find high quality sites.Read more at www.dzone.com/
Thursday, August 03, 2006
SourceForge.net: WebTestClipse
I added WebTestClipse as a project to Sourceforge.net ( http://sourceforge.net/projects/webtestclipse/ ). The idea is, to use Sourceforge.net as a portal and to redirect to http://webtestclipse.canoo.com/ where the project is hosted and developed...
Read more at sourceforge.net/project...
Friday, July 28, 2006
Setting up the master Maven 2 project for WebTestClipse - Install Maven 2
1.) Download Maven 2
Download Maven 2 from http://maven.apache.org/download.html and chose the right distribution. I'm using http://www.apache.org/dyn/closer.cgi/maven/binaries/maven-2.0.4-bin.zip .
2.) Unpack Maven into a local directory
I've chosen C:\dev\maven-2.0.4 as my Maven 2 home directory.
3.) Environment Variable
Define a %MAVEN_HOME% variable and extend the %PATH% variable. This will make it possible to call Maven 2 commands from the command line
4.) Test your Installation
Testing the installation is fairly simple. Just call a Maven 2 command from the command shell:
mvn -v
As a result you should see:
Maven version: 2.0.4
Joined WebTestClipse
I joined the WebTestClipse project. The goal of the project is to provide a set of Eclipse features and plugins to develop tests for WebTest .
Read more at webtestclipse.canoo.com...
Daily IT Thoughts...
Monday, January 09, 2006
Eclipse and Java on USB Memory Stick
Somehow I found portableapps.com which has a nice collection of tools (Firefox, Thunderbird, etc.) which can be copied on the USB memory stick and started from there. This makes it easy to use my favorite browser and mail client...
For me the next question was: can I install Eclipse and Java on the memory stick and use it? Yes, you can :)
Here a short description on what I did:
1.) Copy a current installation of Java to the memory stick. I really copied it, I didn't install it!
2.) Copy Eclipse on the memory stick.
3.) Write a simple batch file to start Eclipse.
that's it!
My directory structure on the memory stick looks like this:
%USB_MEMORY_STICK_ROOT%
| Eclipse.bat
+---Applications
+---jdk1.5.0_05
| \---bin
| \---javaw.exe
|
+---eclipse
\---eclipse.exe
Eclipse.bat looks like this:
.\Applications\eclipse\eclipse.exe
-data .\Projects
-vm .\Applications\jdk1.5.0_05\bin\javaw.exe
-vmargs -Xmx256M
Enjoy :)
Monday, December 19, 2005
Maven 2 - How To: Where to put the properties?
1) The properties, in Maven 1 in build.properties and project.properties, are stored in settings.xml
2) Create the settings.xml in your user directory
Under Windows XP, this is:
C:\Documents and Settings\<user>\.m2\settings.xml
If you have to configure a proxy, it would look like this:
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<proxies>
<proxy>
<active/>
<protocol>http</protocol>
<username>user</username>
<password>passwd</password>
<port>8080</port>
<host>proxy-url</host>
<id/>
</proxy>
</proxies>
</settings>
3) Since settings.xml is not part of your workspace and won't be stored in the project repository, you don't have it within your development environment. I'm using Eclipse for my development and I included the settings.xml in my project as a linked resource to the file system.
This approach gives you the advantage, that you can edit settings.xml easily within Eclipse and you don't have to leave your development environment :)
* * *
Reference:
http://maven.apache.org/maven-settings/settings.html
Saturday, December 17, 2005
Maven 2 - How To: Multiple Module (flat project layout)
1) Create at least two Maven projects in a flat project layout...
%PROJECT_WORKSPACE%\%YOUR_PROJECT_MASTER%pom.xml
...
%PROJECT_WORKSPACE%\%YOUR_PROJECT_SLAVE%pom.xml
...
2) Define the <groupId> and <artifactId> of the modules...
%PROJECT_WORKSPACE%\%YOUR_PROJECT_MASTER%\pom.xml:
<project>
...
<groupId>somegroup.master</groupId>
<artifactId>master</artifactId>
...
</project>
%PROJECT_WORKSPACE%\%YOUR_PROJECT_SLAVE%\pom.xml:
<project>
...
<groupId>somegroup.slave</groupId>
<artifactId>slave</artifactId>
...
</project>
3) Define the modules in the master project...
Here I added first the artifactId, but it didn't work. I changed it to the directory and everything was fine.
%PROJECT_WORKSPACE%\%YOUR_PROJECT_MASTER%\pom.xml:
<project>
...
<modules>
<module>../%YOUR_PROJECT_SLAVE%</module>
</modules>
...
</project>
4) Add the <parent> and <dependency> element in the slave module...
%PROJECT_WORKSPACE%\%YOUR_PROJECT_SLAVE%\pom.xml:
<project>
...
<parent>
<groupId>somegroup.master</groupId>
<artifactId>master</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
...
<dependencies>
<dependency>
<groupId>somegroup.master</groupId>
<artifactId>master</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
...
</dependencies>
...
</project>
5) Call mvn install...
First the master project will be called and than slaven... That's it :)
* * *
References:
- http://maven.apache.org/
- http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html
- http://maven.apache.org/guides/mini/guide-ide-eclipse.html
Maven 2 - How To: Add LICENSE.txt
1) Add LICENSE.txt to the root directory of your project...
%YOUR_PROJECT% pom.xml
LICENSE.txt
src site ...
2) Copy your license into LICENSE.txt
3) Include the <licenses> element in the pom.xml...
%YOUR_PROJECT%\pom.xml:
<project>
...
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>LICENSE.txt</url>
</license>
</licenses>
</project>
4) Inculde project ${reports} in site.xml
%YOUR_PROJECT%\src\site\site.xml:
<project>
...
${reports}
</body>
</project>
Maven 2 - Collection of How-To's
I'm currently migrating two projects to Maven 2 (http://maven.apache.org/) and decided that I'll document this within my blog.
Although the Maven documentation has grown a lot, I'm still having difficulties to find the right piece of documentation to get my things done. Often I have to check the Maven repository to see how the Maven guys did it. By the way - I think this is a great advantage of open source ;) I hope and I'm quite sure, that this will improve a lot within the next few weeks and months.
Since I forget very fast ;) (very-very short time memory), I'll write down a collection of How-To's, where I describe little tasks. Maybe this will be helpful for other people too...
Working Offline
Currently I'm spending many hours working offline and this wasn't very easy when I started doing it. I was used to have internet access 24x7. Since I'm in Thailand (see http://tomionthai.blogspot.com/) now and I don't have an internet access at the place I'm staying, I had to find a new way of working.
My first approach was saving the websites with Firefox (http://www.mozilla.org/) for offline reading and Google Desktop Search (http://desktop.google.com/) for indexing all the pages. After a while I switched from Firefox to HTTrack (http://www.httrack.com/) for downloading the pages, since it allows the download of a complete website with all the links and referenced pages. This approach was ok, but had its disadvantages like:
1) I had to come up with my own directory structure to save all the websites.
2) Using Firefox wasn't very comfortable since it tries to save the file with the URL file name. This is very unpleasant if you have a site providing dynamic content and it's using post - every URL looks exactly the same and you will have to rename each file you would like to save locally.
3) Some websites can't be downloaded with HTTrack (or at least I didn't find the right configuration). I spent hours to find the right configuration for downloading Maven (http://maven.apache.org/), but I wasn't very successful.
4) It took quite some time to start and configure HTTrack everytime I wanted to have a certain page for offline reading.
5) Often I downloaded much more than I wanted with HTTrack, which resultat in very long download times and waste of diskspace.
But the biggest drawback was, that this approach saved a lot of garbage on my laptop, which I dind't wanted. Most of the pages show headers, footers, menus and a lot of advertisement. By using Firefox or HTTrack all of this was downloaded as well and resultet in bad search results in Google Desktop Search, this because menus referenced to other pages with the actual content and this menu links contained my search key words, of course Google Desktop Search listed them too.
Finally I found a much nicer and even easier approach. My dream team is called PDFCreater (http://pdfcreator.sourceforge.net/, http:www.pdfcreator.de.vu/) and Google Desktop Search. Everytime I see a page, an article or some content I would like to read offline, I print it with PDFCreator and save the pdf file on my disk. First of all, many pages offer a printer-friendly version of the content which results in a nice print and in this case in a nice pdf file. I don't have to create complex directory structures anymore, I just created a simple structure with meta descriptions and I save all the pages/pdfs in these directories. Google Desktop Search has no problem indexing the pdf files and it's also nicer to read them in Acrobat Reader (http://www.adobe.com/) than in Firefox. The final advantage for me is, that I can easily backup all the files and I use them as my knowledgebase.
If you have to work a lot offline, but you still would like to read current articles from the internet, you might want to try this approach. If you have a better approach, I'm very interested in knowing it... thanks in advance :)
Thursday, December 15, 2005
Java XML Binding
I'm working right now on CreateTree, a simple tool for reading and
creating directory and file structures, CreateTree is a part of the BDT
project (http://bdt.sf.net/).
The model is defined in a XML Schema and finally transformed with Apache
XML Beans into a Java model.
Before I decided to use Apache XML Beans, I had a look at
https://bindmark.dev.java.net/, a project which compares Java XML
Binding tools.
Since I don't have much experience with bind tools, Bindmark is very
helpful and provides a lot of information.
Thursday, December 01, 2005
New Eclipse help plugin for eclipse-tutorial.dev.java.net available
I developed a new Eclipse help plugin, containing all the tutorials from eclipse-tutorial.dev.java.net. With the new plugin, you can select the tutorials you would like to see and you don't have to download all of it at once.
This will help us to deliver new tutorials easier for the help plugin.
You can find the Eclipse help plugin under:
Enjoy :)
Tuesday, November 22, 2005
New visual tutorials available
- Ant Code Templates
- Generating Ant Buildfile for Eclipse Java project
- Create a new Perspective
- How to use the Help System
https://eclipse-tutorial.dev.java.net/
Enjoy!
Saturday, October 15, 2005
Great Ranking for eclipse-tutorial.dev.java.net
Correct me if I'm wrong, but it looks to me, that the other 9 projects in the list have a very close relation to java.sun.com. If this is right, I think the 3rd rank is simply great :)
Saturday, October 01, 2005
Joomla Developer
It's amazing to see, what momentum is behind some people :) I wish them all the best in developing Joomla and increasing the community!