Seit einiger Zeit entwickle ich Tapestry 5 in Eclipse und es ist an der Zeit nach guten Plugins zur Unterstützung zu schauen. Bisher hat es nicht viel gegeben, aber heute starte ich eine neue Recherche.
Basis-Setup:
Borut Bolčina schreibt einen Blog über Tapestry 5. Dort hat er sehr ausführlich beschrieben, wie man das Basis-Setup seiner Entwicklungsumgebung macht.
Dort ist auch die Einrichtung von Eclipse Tidy beschrieben. Eclipse Tidy ist super, um HTML-Dateien zu formatieren, aber mit Tapestry gibt es das Problem, dass man ständig neue Komponenten entwickelt und diese mit t:myComponent in den TMLs referenziert. Jede neue Komponente muss man dann in den Eclipse Tiny-Einstellungen hinzufügen. Das kann - insbesondere bei vielen Entwicklern an einem Projekt - sehr nervig werden. Andererseits: Wenn man es gleich von vornherein durchzieht geht es vielleicht.
Code-Completion:
Einen immensen Umfang an Code-Templates findet man im Tapestry Wiki: Tapestry5HowToEclipseCodeTemplates
Im Wiki findet man auch einen Beitrag über Code-Completion in TMLs. Das ist großartig!
Pugins:
Nun aber endlich zu den Plugins. Bisher habe ich loom-t5 von Chris Scheid und tapestry4e von Juan M. Salamanca gekannt und dabei wird es leider auch bleiben, da ich keine weiteren Plugins gefunden habe. In wie weit sich diese Plugins lohnen, schreibe ich im kommenden Blogpost.
Fazit:
Auch wenn ich leider keine neuen Plugins gefunden habe, welches mir eine Verbindung zwischen den TMLs und den Java-Klassen schafft - so dass zum Beispiel die in einer Klasse eingebundenen Komponenten, Properties, etc. im TML mit Code-Completion verfügbar sind: Es lohnt sich immer mal zu schauen, was es Neues gibt.
Posts mit dem Label Java werden angezeigt. Alle Posts anzeigen
Posts mit dem Label Java werden angezeigt. Alle Posts anzeigen
2010-10-04
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.
Troubleshooting Common Problems
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
- seleniumhq.org > Docs > 02 selenium basics: <http://seleniumhq.org/docs/02_selenium_basics.html#commonly-used-selenium-commands>
Selenium Commands
- seleniumhq.org > Docs > 04 selenese commands: <http://seleniumhq.org/docs/04_selenese_commands.html>
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.
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.
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
- seleniumhq.org > Docs > 05 selenium rc: <http://seleniumhq.org/docs/05_selenium_rc.html#adding-some-spice-to-your-tests>
Troubleshooting Common Problems
- seleniumhq.org > Docs > 05 selenium rc: <http://seleniumhq.org/docs/05_selenium_rc.html#troubleshooting-common-problems>
Test Design Considerations
verify/assertTextis 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-16
Thomas Reppa: PureMVC - Introduction + Best Practise
Vortrag von Thomas Reppa: PureMVC - Introduction + Best Practise
PureMVC ist ein leichtgewichtiges Framework um MVC Anwendungen in sehr modularer Weise zu erstellen.
- PureMVC ist eher ein Regelwerk
- PureMVC ist sprachenunabhängig (impl. in vielen Sprachen vorhanden)
- Man programmiert Inseln, die man anschließend zusammenfügt.
- PureMVC ist Kommunikationsschnittstelle zwischen Views und Models.
- „Code in the Speed of Thought.“
Meine Gedanken:
PureMVC ist ein vielversprechender Ansatz. Allerdings konnte mich der Vortrag leider noch nicht überzeugen, ob in großen (also richtig großen) Projekten das Problem der verwirrenden Verbindungen zwischen Views und Models hiermit zufriedenstellend gelöst werden kann, da nur kleine Beispiele in dem Rahmen gezeigt werden konnten.
2009-05-27
First Steps With Java on Google App Engine
Pre-stuff to get it run first:
- I sign up for an App Engine account.
- Downloaded the App Engine SDK and installed the Eclipse plugin.
- Create a new project as described in the Quick Start Reference.
- The Quick reference says for deploying (after you have created an application): "Once you have an application ID, just right-click on your project, and select Google > App Engine Settings... from the context menu. Enter your application ID into the Application ID text box. Click OK."
- I found it quite hard to find the ID until I realized that it is the name itself found in the "Application" column on my apps listing at http://appengine.google.com/. (This is more clear if you just created your app.) So its "peters-cafe" in my case.
- I found it quite hard to find the ID until I realized that it is the name itself found in the "Application" column on my apps listing at http://appengine.google.com/. (This is more clear if you just created your app.) So its "peters-cafe" in my case.
- Then just hit the turbine button (Deploy App Engine Project) within eclipse, and here we go...
...I thought, but got an error: "Unable to upload app: Error posting to URL: http://appengine.google.com/api/appversion/create?app_id=peters-cafe&version=1&
400 Bad Request
Invalid runtime or the current user is not authorized to use it."
--Hmm
- I re-checked the developers settings on the app dashboard, but I still was an active developer :-(
- Tried wrong credential infos -> PSW doesn't match. So that must be right.
- Found it here in Java FAQ: I'm getting "Invalid runtime specified." when I try to upload.
Acctually I do not have permission to upload a Java app to my account. That's what they say: "To request permission to upload an app which uses the Java runtime, sign up at the following URL: http://appengine.google.com/promo/java_runtime . For now, access will be limited to the first 10,000 to sign up."
-> sTo request permission to upload an app which uses the Java runtime, sign up at the following URL: http://appengine.google.com/promo/java_runtime . For now, access will be limited to the first 10,000 to sign up.
-> so nothing to do here, but wait...
It is possible, to run the app local, of course, so I will start to develop and test my app locally.
My first steps, developing a Java application with Google App Engine will be reported soon.
Edit Post:
Finally
I got my permission to upload, so here we go: http://peters-cafe.appspot.com/
(Just the default app, currently)
Labels:
appengine,
Eclipse,
Google,
Google App Engine,
Java,
webdevelopment
Abonnieren
Posts (Atom)