Post By Vilmos Somogyi ~ 14th May 2010
This post is a duplicate of http://alasdoo.com/2010/05/util-library-to-be-used-with-selenium-under-bromine-3/
In the previous tutorials we have set up Bromine to run with Selenium Java test cases, so now it’s time to create a util library that will hold the classes used in multiple projects.
For now we have created a new project in eclipse for each test case, and talked about the placement of the libraries needed by Bromine and Selenium. Let me refresh your memory. Bromine requires each test case to be a separate JAR, so for each of them we created one project in eclipse and used the ant build script to create these jars.
In order to run the selenium script we need to add the dependency libraries to the classpath. There are two ways to do this. First is to include all the libraries in the newly created jar, but this will result in bigger file size, and we will have the same libraries on multiple places if we have more than one test case. This violates the DRY (don’t repeat yourself) principal, so we used the second option, which is to have the dependency libraries placed in a known location on the disc, and just to include their path in the classpath.
If we have a part of code that we want to use on multiple places, it is a good idea to place it in a separate class and just call a method instead of copying the same code over and over again. If this code is used in multiple test cases, then we can put it in a library and just include it to the classpath, the same way we did the other dependencies. Let me show you how this is done.
The test cases that we are using need to get some values from the Oracle database, and to check if those values are present on the web page we are testing. This means that we will need a jdbc driver to connect to the Oracle database, a connection pool that we can use to checkout a connection to the database, and a util class that holds the code for the select, update and delete statements. We will make this code as generic as possible, so we can put it in a library and just use it as a dependency in the other test cases.
Let’s create a new project in Eclipse by choosing New Java Project, and add a name. We will call it “ALAS_db”.
… Read Full Post >>
Post By Vilmos Somogyi ~ 20th April 2010
This post is a duplicate of http://alasdoo.com/2010/04/compiling-a-java-code-for-bromine-in-eclipse/
Bromine v3 requires the Java code to be compiled and packed in an executable JAR. In the previous tutorial we covered the recording of the test case with Selenium IDE and its conversion to a Bromine ready format. Now we will focus on the compiling of the Java code, and see two ways to create the executable JAR file in Eclipse. We assume you already have downloaded Eclipse and set it up, so we can jump into creating magic.
- Open the Java project creation wizard (File -> New -> Other -> Java Project)
- Enter a Project name. ALAStest in our case.
- Make sure to select “Use project folder as root for sources and class files” in the Project Layout section. This will be crucial for the second way of creating the JAR file, and I will describe this later on in this tutorial.
- Click Finish, and a new project is created.
- Now we want to add the Java code for our test case. As I mentioned earlier, we used the Selenium IDE to record the test case, and we exported it to Bromine friendly Java code. Create a new Java Class file, and leave the Package field empty. Once its done, copy the exported code to this file, and make sure all of the existing code in it is rewritten. There is another, easier way to do this file creation in Eclipse. In Package Explorer click the project and just paste the copied code. Eclipse will create a new Java file for you and place it in the appropriate location.
… Read Full Post >>
Post By Vilmos Somogyi ~ 16th April 2010
This post is a duplicate of http://alasdoo.com/2010/04/running-test-cases-in-bromine-v3/
This is a short tutorial with screenshots on how to create and run test cases in Bromine v3. We’ll follow a few easy steps that will include recording the test case with Selenium IDE, creating a JAR file and finally adding it to Bromine and running it. So, lets begin.
Create a test script
There is more then one way to create a test script that will be run on Selenium server, and we will of course use the easiest one 
Selenium IDE is the tool for us. It is an extension for Firefox, that enables us to record a test cases by simply clicking in Firefox’s main window. The IDE allows us to export the recording in multiple programming languages supported by Selenium, so we can have a complete test case in our desired language without typing a word. And here comes to big BUT. Bromine can’t run test scripts recorded like this. We need to add some extra variables and code that will enable our test cases to communicate with Bromine. Don’t be scared, we still don’t need to do any coding ourselves, thanks to the good falks at Bromine development. They have created a special format code that will enable Selenium IDE to export the recorded test script to Java and PHP that is specially formed for use with Bromine. All we need to do is to add this code to Selenium IDE:
- Download and install Selenium IDE (http://seleniumhq.org/download/)
- After restarting Firefox, open it from Tools -> Selenium IDE
- Now we have the IDE window, and we can add the new format to it
- Open Options -> Options…
- Select the Formats tab and click the Add button
- Selenium IDE Format Source window is displayed. Enter a name for the format: Java-Bromine (for example)
- Copy the content of <webroot>/IDE-formats/BR3-java.txt (or BR3-php.txt if you are using PHP for the test cases) and paste it in the text area (make sure you overwrite the existing code).
- Save it and close the options window.
- Now we can record the test case.
- Once its done, choose File -> Export Test Case As… -> Java-Bromine and save it on your disk.
… Read Full Post >>
Post By Vilmos Somogyi ~ 13th April 2010
This post is a duplicate of http://alasdoo.com/2010/04/setting-up-bromine-v3-with-selenium-rc/
Start Selenium RC
- In Windows open up Command Prompt (Start->Run and type cmd)
- Navigate to the directory where selenium was unzipped (cd \selenium\selenium-server-1.0.3 in my case)
- Start the server (java -jar selenium-server.jar)
Configure Bromine
- Login with admin/admin
- Click “Or go to the Control Panel”
Adding nodes
- Navigate to the NODES page. Here you can see all the configured Selenium RC nodes. There are two preconfigured nodes, and we’ll delete them to clean up this page. Once deleted with the Delete button from the actions column, we can add a new one
- Click on NEW NODE and fill in the form with these values:
Nodepath: localhost:4444 (this needs to reflect the IP and the port the Selenium RC server is running on)
Operating system: Windows 7 (if you can’t find your OS in the list, add it on MISC->OPERATING SYSTEMS page)
Description: Selenium RC on Win 7
Browser: Firefox (select the available browsers on your OS)
Post By Vilmos Somogyi ~ 12th April 2010
This post is a duplicate of http://alasdoo.com/2010/04/install-bromine-v3/
Prerequisites
Selenium requires Java, so this means that even dough you want to run tests in some other programming language (Python, Ruby, PHP), you still gonna need Java.
Selenium Setup
- Install Java version 1.5 or older (if not already installed on your machine)
- Download Selenium RC from http://seleniumhq.org/download/
- Unzip it to a known location (we’ll use c:\selenium) and you are ready to run it.
Web Server & DB setup
- Install XAMPP. This will automatically install both Apache and MySQL.
- Start XAMPP to make sure both apache and mysql start correctly.
Apache runs on port 80, so make sure it is free on your computer, or change the settings for Apache, and in that case make sure to use the newly set port for the next steps
… Read Full Post >>
Post By Vilmos Somogyi ~ 14th November 2008
If you want to apply different styles for different folders on your Plone 3 site then this is what you should do:
1. look at source code of generated page and look for body tag and it should have some classes, one of those classes starts with section-…, that class tells you the folder that contains your page, note that page in root folder will not have this section-… class
2. when you have class names just make custom styles with CSS that will override the original and that’s it, but make shore that classes definitions that override are bellow classes definitions that are being overridden in CSS file
This works for one level of folders, if you need to apply different styles to folders with more than one level of depth you need to override the getSectionFromURL, more about this you can find at Alex Clark’s blog.
Post By Vilmos Somogyi ~ 24th September 2008
This makes it possible to share configuration across multiple buildouts, and save some time and disk space.
To set “global” options affecting all buildouts:
… Read Full Post >>
Post By Vilmos Somogyi ~ 24th September 2008
Solution for this under Linux is very simple. All you need to do is to tell your SVN client that it has a Proxy on it’s way to the SVN server. This is done by editing file .subversion/servers in your home directory.
… Read Full Post >>
Post By Vilmos Somogyi ~ 17th September 2008
Here are a few steps you need to take to be able to run Plone on a newly installed Ubuntu. I’m using Hardy Heron 8.04, so on the previous versions of Ubuntu may vary this procedure.
… Read Full Post >>
Post By Vilmos Somogyi ~ 17th September 2008
If you want to start learning Plone, here is a list of books you should read:
1. “Professional Plone Development”
http://www.packtpub.com/Professional-Plone-web-applications-CMS/book
2. “A Comprehensive Guide To Zope Component Architecture”
http://www.muthukadan.net/docs/zca.html
… Read Full Post >>