Friday, 15 April 2011

How to add a new item to the status field in Bugzilla?

To add a new item to the status field, namely 'Reopen'. In the admin section of zilla its clearly there. Now when we 
go to edit a bug we can never see this new field, all we can initially see is Assigned, New, Resolved. After changing the bug status to Resolved we can then see some other statuses like Reopened, verified 
and closed but not 'Reopen'.


To solve this i have followed the steps which is mentioned below:


1. From Administration>Field Values>Status, make sure that the new status
you created is open for bug entry. 


2. Once this is done, on Administration>Bug Status Workflow, make sure the
status transitions are set. 

Friday, 18 February 2011

selenese converter

Hi friends,
            Did you hear about selenese converter (from html to java(junit))?, Few months back i got a chance to work liferay's selenium testing, in that they have already written a java file to convert many html files to java files at one shot. So using that idea i started working to create a converter for all websites.
(one more point i forgot to say with handling the dynamic id's in web page.)

Hope i will finish it soon and update the status in my blog.

Wednesday, 2 February 2011

What is maven?

Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information.

Maven's Objectives
Maven's primary goal is to allow a developer to comprehend the complete state of a development effort in the shortest period of time. In order to attain this goal there are several areas of concern that Maven attempts to deal with:
  • Making the build process easy
  • Providing a uniform build system
  • Providing quality project information
  • Providing guidelines for best practices development
  • Allowing transparent migration to new features
For more details follow this link :http://maven.apache.org/guides/getting-started/index.html

Wednesday, 5 January 2011

Batch file creation to run the selenium server

Hi,
    I have tried to create a batch file to start the selenium server for three different environments, Almost it takes one whole week for me to create a batch file because i am new to this batch file creation.

So i would like to give the sample batch file code so that you can modify as per your requirements.

Sample batch file code:


ECHO OFF
SET JAVA_HOME="C:\Program Files\Java\jdk1.6.0_20"
SET ANT_HOME="C:\Program Files\ant"
SET PATH=%JAVA_HOME%\bin;%ANT_HOME%\bin;%PATH%

echo Please Enter The environment
set /p Key= Here -^>

echo.

:BEGIN

IF %key% == tst GOTO TST
IF %KEY% == dev GOTO DEV
IF %key% == uat GOTO UAT

:TST
echo YOU HAVE ENTERED TST ENVIRONMENT
java -jar path to \selenium-server.jar -port 4440  -multiwindow -htmlSuite "*firefox " "website url" "path to\MainSuite.html" "path to\Results.html"
GOTO END
:DEV
ECHO YOU HAVE ENTERED DEV ENVIRONMENT
ava -jar path to \selenium-server.jar -port 4441  -multiwindow -htmlSuite "*firefox " "website url" "path to\MainSuite.html" "path to\Results.html"
GOTO END
:UAT
ECHO YOU HAVE ENTERED UAT ENVIRONMENT
ava -jar path to \selenium-server.jar -port 4442  -multiwindow -htmlSuite "*firefox " "website url" "path to\MainSuite.html" "path to\Results.html"
GOTO END
:END

Try this and do magic in your automation world

All the best

Monday, 3 January 2011

How to run liferay's selenium script in jmeter for performance testing

Hi friends,
please click the link which is mentioned below so that you can solve this problem easily.

url: http://www.mpowerglobal.com/web/neelu/home/-/blogs/how-to-run-liferay-s-selenium-script-in-jmeter-for-performance-testing?_33_redirect=http://www.mpowerglobal.com/web/mpower-india/blog%3Fp_p_id%3D115%26p_p_lifecycle%3D0%26p_p_state%3Dnormal%26p_p_mode%3Dview%26p_p_col_id%3Dcolumn-2%26p_p_col_count%3D1

How to solve permgen space error while starting the tomcat

HI ALL,
A week ago i have configured hudson continuous integration tool for one of my project, In that i should need to start tomcat server through bootstrap.jar using .xml file but i couldn't start it, reason is memory out of bound exception ie. permgen space error.

Here i would like to share my approach to solve this problem.

Steps to resolve the permgen space error while starting the tomcat through bootstrap.jar

Step 1. Create a build.xml file to start the tomcat server. sample code is mentioned below.

Sample .xml file

<?xml version="1.0"?>

<project name="markettravel" basedir="." default="all">
<target name="tomcat-start">
<java jar="path to /bootstrap.jar" fork="true">
<jvmarg value="-Dcatalina.home=path to tomcat-6.0.26"/>
<jvmarg value="-XX:MaxPermSize=512m"/>






In above code i have added one argument to allocate the perm memory size(jvmarg value="-XX:MaxPermSize=512m").

Step 2:

Now include this .xml file path to hudson tool and start building the project now you never see memory out of bound exception in console.

Happy using hudson.

Monday, 6 September 2010

How to handle ssl certificate error in firefox

Hi all,
As soon as your tests redirect to an HTTPS URL on the same host, where your SSL certificate is self-signed, things go wrong. As Selenium effectively runs Firefox with a new profile every time, you potentially lose any certificate exceptions you might accept.
One technique we were using was to create a custom profile; run Firefox using that profile; browse to the HTTPS URL and accept the exception into that profile; then close the profile.

Steps to create a Firefox profile:
1. Close down any running Firefox instances.
2. Start Firefox (the one you're going to run your tests with) with the profile manager: firefox –ProfileManager using command prompt.
3. Create a new profile. You'll be prompted to choose a directory for the profile. Put it somewhere inside the project where you're writing the tests.
4. Select the profile and run Firefox using it.
5. Browse to the HTTPS URL (with self-signed certificate) you're going to be testing against.
6. Accept the self-signed certificate when prompted. This creates an exception for it in the profile.
7. Close the browser.
8. Go to the Firefox profile directory.
9. When you run your Selenium server, pass a -firefoxProfileTemplate /path/to/profile/dir argument to it. This tells Selenium to use your partial profile (with certificate exceptions) as a basis for minting its new profile. So you get the certificate exceptions, but without any of the other clutter you would get if you used a whole profile.


command for using the firefox profile template in selenium server.

java -jar selenium-server.jar -firefoxProfileTemplate /path/to/profile \
-htmlSuite “*chrome firefox-bin” “http://host.com” “testSuite.html” “seleniumResults.html”

How to run selenium testing in liferay

Hello ALL,
In this blog i have explained briefly about selenium configuration with liferay, liferay source itself has its own selenium scripts in the following path.

D:\liferay-portal-src-5.2.3\portal-web\test\com\liferay\portalweb

Before running the selenium default liferay scripts, we need do some changes in properties files, like test-portal-web.properties and portal-ext.properties.

edit few lines in test-portal-web.properties file like following sample code.

selenium.host=localhost
selenium.port=4444

#browser.type=*chrome
#browser.type=*firefox
#browser.type=*iehta
browser.type=*iexplore

company.id=1
portal.url=http://localhost:8080


Edit portal-ext.properties(inside server you have to create this file)

In this file we need mention "captcha.max.challenges=-1" this sentence to avoid captcha.

after this we need to open a command prompt and execute the following command.

ant start from d:/portal-src

once build successful we need start selenium-server and also liferay's tomcat server.

Finally we need to execute one more command from command prompt.

ant test from D:\liferay-portal-src-5.2.3\portal-web

now you can able to see the selenium scripts are running in liferay portal successfully.

Hope this will help lot for liferay testers in selenium.

To run selenium scripts(html) parallel

I used to run selenium scripts one-by-one in selenium rc, in that case it will take 3 to 4 hours to execute all the scripts completely. client will not wait such a long time to get the results. for that i have taken a selenium grid concept to run selenium scripts(html) and one more thing also using selenium grid we cant run selenium html scripts we can run only selenium scripts in java and c#.

Before running our scripts parallel we need to create one .xml file, so i have given one example .xml file. try to understand this file then you will able to create your own .xml for your projects.

.xml sample:



Steps to run our scripts in parallel.

Step 1: download psexec.exe file from google and paste it inside your scripts folder.

Step 2. open command prompt and run the following command.
ant Main

Main is target name you can change whatever you want.

How to speedup selenium scripts in firefox

Some time our selenium scripts will take more time to execute in firefox and also timeout error will come in this case. so we need to configure our firefox profile. Here i have mentioned some steps for configuring firefox profile. after this configuration we can avoid unwanted pop-ups.

Suggested settings for your Selenium Profile

1. From “View\Toolbars” tab, uncheck “Bookmarks Toolbar”
2. Right click from toolbar and click “Customize”
3. Remove “Google search” by dragging it to the “Customize Toolbar” window
4. From the “Customize Toolbar” window, click “Use Small Icons” check box then hit “Done”
5. Click “Tools\Options” then set the following:
a. “Main” tab
- set Home Page to “about:blank”
- uncheck “Show the Downloads..” option
b. “Tabs” tab
- Select “a new window” for new pages
- Uncheck all warning options
c. “Content” tab
- uncheck “Block pop-up” windows option
d. “Privacy” tab
- uncheck all “History” options
e. “Security” tab
- uncheck all “Security” options
- click “Settings” and uncheck all warning options
f. “Advanced” tab
- Uncheck “autoscrolling” option from “General” tab
- uncheck “warn me …” and “Ssearch Engines”option from “Update” tab
6. From “Tools\Add-ons” install the following:
- Firebug: allows you to edit, debug, and monitor CSS, HTML, and JavaScript on your application under test
- Selenium IDE: allows you to record, edit, and debug Selenium tests
- ScreenGrab: saves entire webpages as images.
7. From the address bar type “about:config” and add the following by right-click anywhere on the page and selecting “new”
- extensions.update.notifyUser (type=boolean; value=false)
- extensions.newAddons (type=boolean; value=false)

Always try to be smart:)

selenium+jmeter+junit

Hi,
This is the first and very useful post for all, after a month i have found solution for jmeter. how to use selenium scripts for jmeter for test the performance testing. so i have configured successfully and my selenium scripts are running successfully in jmeter. i have listed those steps below.

Steps:

Step1. Record and convert your script to selenium java-junit format
using selenium ide.

Step2. open the eclipse and save that file as a java file.

Step3. Using junit run that file but before that you need to add
selenium-server.jar file in eclipse.

Step4. After that test runs successfully you will get .class file
under bin folder.

Step5. Setup your Run configuration settings for converting java file
to jar.

Step6. Select .java file and .class together and convert to .jar file.

Step7. Paste that .jar file into lib/junit folder.

Step8. start your j-meter server and see the magic.