2010-09-30

Kalender App fürs iPhone

Vor einigen Wochen habe ich endlich eine vernünftige Kalender App für das iPhone gefunden: Week Cal - iCal for your iPhone.
Man hat eine gesamte Woche im Überblick und dank des hochauflösenden Displays des iPhone 4 kann man - wenn man die Schriftgröße auf minimal setzt - sogar bei parallelen Terminen alles lesen.

2010-09-28

ctrl-z und Eclipse auf dem Mac

Ich verwende Eclipse 3.4 auf dem Mac, habe meine Sprache in OSX auf Deutsch eingestellt und habe eine US-Tastatur im Notebook.

Als Keyboard-Layout habe ich das USGerman Keyboard Layout von http://hci.rwth-aachen.de/USGermanKeyboard. Das ist großartig, da man so einfach mit option+a, etc. die deutschen Umlaute 'zur Hand' hat.

Woran es genau liegt, weiß ich nicht, aber mein Eclipse (US Version) reagiert nicht auf cmd+z, um einen Schritt rückgängig zu machen, sondern auf cmd-y. Man gewöhnt sich da zwar dran, aber heute stelle ich das mal um.
Unter Eclipse -> Preferences... -> General -> Editors -> Keys finde ich die richtige Einstellung: Undo: cmd-z, Redo: cmd-y. Wenn ich diese Werte ändere, erkennt die Kiste erstaunlicherweise y als Z und z als Y. Warum auch immer, denn an allen anderen Stellen in Eclipse (zumindest habe ich noch keine gefunden) bleibt mein y ein y und mein z ein z.

Ich habe nun also Undo auf cmd-Y gelegt, indem ich cmd-z gedrückt habe und Redo auf shift+cmd+Y, indem ich shift+cmd+z gedrückt habe. -> Jetzt muss ich nicht mehr umdenken, aber mal sehen wie lange ich brauche, nicht mehr wie bisher cmd+y als Workaround zu benutzen.

2010-08-12

Selenium web application testing system

Selenium is a testing framework for Web Applications. With a Selenium test environment, you can programmatically create tests and run them as often as you need. This will ensure that you do not accidentally destroys any previously developed feature during later on development. 


Last year, I set up such a Selenium test environment at work. During the preparation for installing such an environment for a customer, I created a "have-to-read" documentation. It summarizes important issues for the use of Selenium. It is for developers who want to use a Selenium installation, to write their own tests. The information comes--largely--from the selenium-site http://seleniumhq.org/ and is represented here as a "short documentary"--the essentials at a glance with links to the source Selenium Documentation.


If you want to start with selenium, and the framework is set up already, then check this out. 

Commonly Used Selenium Commands

Selenium Commands

Selenium Server

Selenium Server receives Selenium commands from your test program, interprets them, and reports back to your program the results of running those tests.
The RC server bundles Selenium Core and automatically injects it into the browser. This occurs when your test program opens the browser (using a client library API function). Selenium-Core is a JavaScript program, actually a set of JavaScript functions which interprets and executes Selenese commands using the browser’s built-in JavaScript interpreter.
The Server receives the Selenese commands from your test program using simple HTTP GET/POST requests. This means you can use any programming language that can send HTTP requests to automate Selenium tests on the browser.

Client Libraries

A Selenium client library provides a programming interface (API), i.e., a set of functions, which run Selenium commands from your own program. Within each interface, there is a programming function that supports each Selenese command.
The client library takes a Selenese command and passes it to the Selenium Server for processing a specific action or test against the application under test (AUT). The client library also receives the result of that command and passes it back to your program. Your program can receive the result and store it into a program variable and report it as a success or failure, or possibly take corrective action if it was an unexpected error.

Learning the API

Starting the Browser

$this->setBrowser("*firefox");$this->setBrowserUrl("http://www.google.com/");
This example opens the browser and represents that browser by assigning a “browser instance” to a program variable. This program variable is then used to call methods from the browser. These methods execute the Selenium commands, i.e. like open or type or the verify commands.
parameters
  • host: Specifies the IP address of the computer where the server is located. Usually, this is the same machine as where the client is running, so in this case localhost is passed. In some clients this is an optional parameter.
  • port: Specifies the TCP/IP socket where the server is listening waiting for the client to establish a connection. This also is optional in some client drivers.
  • browser: The browser in which you want to run the tests. This is a required parameter.
  • url: The base url of the application under test. This is required by all the client libs and is integral information for starting up the browser-proxy-AUT communication.

Running Commands

Once you have the browser initialized and assigned to a variable (generally named “selenium”) you can make it run Selenese commands by calling the respective methods from the browser variable. For example, to call the type method of the selenium object:
selenium.type("field-id","string to type")
In the background the browser will actually perform a type operation, essentially identical to a user typing input into the browser, by using the locator and the string you specified during the method call.

Adding Some Spice to Your Tests



Troubleshooting Common Problems






Test Design Considerations

  • verify/assertText is the most specific test.
  • With Xpath and DOM you can locate an object with respect to another object on the page.
  • Locate dynamic ID: You need programming logic like:
String[] checkboxIds = selenium.getAllFields(); 
if (!GenericValidator.isBlankOrNull(checkboxIds[i])) {   
    if (checkboxIds[i].indexOF("addFOrm") > 1) { 
        selenium.click(checkboxIds[i]);   
    } 
} 
  • Waiting for AJAX Element:
// Loop 
initialization.for (int second = 0;; second++) {    

    // If loop is reached 60 seconds then break the loop.     
    if (second >= 60) break;     

    // Search for element "link=ajaxLink" and if available then break loop.        try { 
        if (selenium.isElementPresent("link=ajaxLink")) break; 
    } catch (Exception e) {
        // log
    } 

    // Pause for 1 second.
    Thread.sleep(1000); 
} 
This certainly isn’t the only solution. AJAX is a common topic in the user group and we suggest searching previous discussions to see what others have done along with the questions they have posted.
  • UI Mapping: What makes a UI map heplful? Its primary purpose for making test script management much easier. When a locator needs to be edited, there is a central location for easily finding that object.
public void testNew() throws Exception {      
    selenium.open("http://www.test.com");         
    selenium.type(admin.username, "xxxxxxxx");         
    selenium.click(admin.loginbutton);         
    selenium.click(admin.events.createnewevent);         
    selenium.waitForPageToLoad("30000");          
    selenium.click(admin.events.cancel);       
    selenium.waitForPageToLoad("30000");         
    selenium.click(admin.events.viewoldevents);      
    selenium.waitForPageToLoad("30000");
} 
    
admin.username = loginForm:tbUsername; 
admin.loginbutton = loginForm:btnLogin; 
admin.events.createnewevent = adminHomeForm:_activitynew; 
admin.events.cancel = addEditEventForm:_IDcancel; 
admin.events.viewoldevents = adminHomeForm:_activityold; 
  • Data Driven Testing: Refer to the RC wiki for examples of reading data from spread sheet or using data provider capabilities of TestNG with java client driver.

2009-06-30

Google's OpenSocial

OpenSocial ist eine Menge von Programmierschnittstellen für Anwendungen in webbasierten sozialen Netzwerken. OpenSocial wird von Google entwickelt und wurde am 1. November 2007 veröffentlicht. (Quelle: Wikipedia-OpenSocial)
Stichworte zum Bauen von Social Applications
  • Gadgets bestehen hauptsächlich aus HTML und JavaScript.
  • API Namensräume (Javascript) sind opensocial.* und gadgets.*
  • Als Views gibt es in der Klasse gadgets.views.ViewType: Profile View, Canvas View und Home View.
  • Datenhandling/Persistenz findet über opensocial.DataRequest statt. Hierzu zählt auch der Zugriff auf Personen, Beziehungen, Aktivitäten und Nachrichten.
  • Der soziale Graph ist über opensocial.Person erreichbar. Rollen werden in VIEWER und OWNER unterschieden.
  • Aktivitäten: opensocial.Activity. Activity Templates können hierbei häufige Updates kumulieren.
  • Nachrichtenversand: opensocial.Message
  • Internationalisierung über Message Bundles in der XML-Spezifikation des Gadgets möglich.
  • Backend Requests, die über die Möglichkeiten von JavaScript und HTML hinausgehen sollen, können mit gadgets.io.makeRequest() abgesetzt werden. Somit ist der Transfer von HTML-, XML-, JSON- und ATOM-Files möglich. -> JSON, XML und AtomPub können auch über die RESTful API genutzt werden, die neben der JavaScript API existiert.
Quelle: OpenSocial Artikel von Matthias Häsel und Karsten Rieke - http://www.springerlink.com/content/d7624423x371w5v6/

Weitere Infos
Host OpenSocial Apps basierend auf Java oder PHP: Apache Shindig
Let's get this Shindig started


XING und OpenSocial:
XING and OpenSocial


Reblog this post [with Zemanta]

2009-06-16

7 Regeln der Usability

FlashCamp Berlin
aus Vortrag von Ron Hofer: User Experience & Fireflow

Für positive User Experience (UX) sind unter anderem folgende 7 Regeln der Usability notwendig:
  1. Aufgabenangemessenheit (Musikwahl bei einer elektrischen Zahnbürste sprengt den Rahmen und ist daher zu vermeiden)
  2. Selbstbeschreibungsfähigkeit (Dieser Punkt beschreibt sich von selbst)
  3. Erwartungskonformität (Eine Fahrstuhltür öffnet sich wieder, wenn ich mich dazwischen stelle.)
  4. Fehlertoleranz (Ein fehlertolerantes System schlägt mir automatisch on-the-fly z.B. einen freien Benutzername vor, wenn der gewählte bereits vergeben ist. Gutes Bsp. Twitter-Anmeldung)
  5. Steuerbarkeit ("Der Nutzer gibt den Takt an!" Mentales Modell des Nutzers darf nicht gebrochen werden.)
  6. Lernförderlichkeit (Neue Nutzer sind Anfänger des Systems und werden bei der Benutzung immer mehr zu Experten.)
  7. Individualisierbarkeit
UX bedeutet: Was brauche ich? + Was WILL ich?
Die Erwartungen, die an ein Produkt gestellt werden, steigen über die Zeit vom ersten Kontakt (z.B. Werbung) über den Kauf und der Nutzungszeit. Die UX muss ÜBER der Erwartung liegen, um mit dem Produkt zufrieden zu sein. Das heißt im Umkehrschluss, dass das System so eingerichtet sein muss, dass die Zufriedenheit mit der Benutzungsdauer steigen kann!

  • Generelles Problem bei Systemen: Je flexibler ein System ist, um so schlechter ist die Usability.
  • 20% der Funktionen können 80% der Aufgaben erledigen, die restlichen 80% kann man z.B. in Menüs "verstecken".
Akzeptanz/Nutzen von neuen Funktionen lassen sich gut wie folgt testen:
  • Die Feature werden in Form von "Produkten" abgebildet. Jedes Feature entspricht einem Produkt. Der virtuelle Preis ergibt sich aus dem Umsetzungsaufwand der Funktion.
  • Testpersonen bekommen eine begrenzte Menge an virtuellem Geld und können damit einige der "Produkte" kaufen.
  • Die meistgekauften Produkte sind die Feature, die man für die ausgewählte Zielgruppe umsetzen sollte.