Thursday, February 17, 2011

How to do regression testing, and can give one or two examples on that in the same application?


Genernally when we are doing Manual Testing - Regression 
testing can be done in two different scenarios.

1) When tester intially find the defects and sent it to 
developers for fixing the issue .Once the issues get fixed 
whatever the testing done by tester is regression testing 
means he will make sure that fixed defects does not effect 
the application.

2)When requirements changing dynamically means ex- you have 
done testing for application A successfully and suppose for 
same application when new features or functionality are 
added and tester will test the application to find out the 
impact it does the application with new requirements - this 
testing also termed as regression testing.

Wednesday, February 2, 2011

Create user, password and assign prviliges


# Connect to the local database server as user root
# You will be prompted for a password.
#
mysql -h localhost  -u root -p

#
# Now we see the 'mysql>' prompt and we can run
# the following to create a new database for Paul.
#
mysql> create database pauldb;
Query OK, 1 row affected (0.00 sec)

#
# Now we create the user paul and give him full
# permissions on the new database
mysql> grant CREATE,INSERT,DELETE,UPDATE,SELECT on pauldb.* to paul@localhost;
Query OK, 0 rows affected (0.00 sec)

#
# Next we set a password for this new user
#
mysql> set password for paul = password('mysecretpassword');
Query OK, 0 rows affected (0.00 sec)

#
# Cleanup and ext
mysql> flush privileges;
mysql> exit;

Tuesday, February 1, 2011

batch file for creating db in wondows


Create a batch file like creatingdb.bat
copy the following code in the batch file:
cd "D:\Program Files\MySQL\MySQL Server 6.0\bin"
mysql -uroot -proot database_name < e:/database.sql

database.sql should contain the following code

drop database database_name;
create database database_name;

use database_name;

source D:\project name\sql\File.sql
source D:\project name\sql\script.sql
source D:\project name\sql\script_users.sql


Multiple firefox instances


How to use Multiple profiles for Firefox
******************************************************
Download the firefox.exe
double click on firefox.exe
select custom method
uncheck for "quick launch, Desktop icon and startmenu icon"
after installation firefox
uncheck launch firefox and finish
go to "start -> Run"
Enter "firefox.exe -no-remote -P"
Create your profle
if you want to open firefox
go to "Start -> Run"
firefox.exe -no-remote -p
then you can select your profile and click start firefox

How to install multiple Firefox version in XP machine  
******************************************************
first, download and install FF3 to a directory DIFFERENT from the one FF2 is installed in. You might want to make a seperate start group for it too. DON'T start it up yet.

then run {pathToFF2}/firefox.exe -p

this will open the profile manager. Make a new profile, eg testProfile.

Now in your start menu shortcut to FF3, change it to "{pathToFF3}/firefox.exe" -p testProfile -no-remote.


How to open the firefox different versions
"c:\Program Files\Mozilla Firefox\FF2\firefox.exe"  -no-remote -P
"c:\Program Files\Mozilla Firefox\FF3\firefox.exe"  -no-remote -P
"c:\Program Files\Mozilla Firefox\FF3.5\firefox.exe"  -no-remote -P

-------------------------------------------------------------------------------------------------

TestNG

TestNG is yet an another framework to work in JAVA.


there are many features available in the TestNG that you will not find in JUnit.


TestNG Annotations
Following are some of the annotations we have used in our example
@BeforeClass: The annotated method will be run before the first test method in the current class is invoked.
@AfterClass: The annotated method will be run after all the test methods in the current class have been run.
@Parameters: Describes how to pass parameters to a @Test method.
@Test: Marks a class or a method as part of the test.

If you look at the @BeforeClass and @AfterClass annotation they are same as of JUnit, the only difference is the method annoted with @BeforeClass or @AfterClass need not to be static as compared to the JUnit.



Google.java



import static org.testng.AssertJUnit.*;
import org.testng.annotations.*;
import com.thoughtworks.selenium.*;
public class Google {
private Selenium selenium;
@BeforeClass
public void startSelenium() {
selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://www.google.com");
selenium.start();
selenium.open("http://www.google.com");
}
@AfterClass(alwaysRun=true)
public void stopSelenium() {
this.selenium.stop();
}
@Test(groups="search")
public void googling() {
try {
selenium.type("name=q", "sasidhar");
selenium.click("name=btnG");
selenium.waitForPageToLoad("60000");
assertTrue(selenium.isTextPresent("sasidhar"));
} catch (SeleniumException e) {
fail(e.getMessage());
}
}
}




Then compile the above program