Tuesday, September 6, 2011

StoreText in Selenium IDE



How user uses StoreText in Selenium IDE


When we want to reuse the data then we can use storetext command in SeleniumIDE.

It will store a value in a variable name then we can use that variable at any time in the same TestCase.

storeText(locator, variableName)

Here locator means location of an element, variableName means we have to declare the variableName.

then whenever we want to use same element then we can reuse that varialbe

Example
storeText(locator, variableName)

type(locator, variableName)

here we are storing the user name in the "ssss" variable
storeText(username, ssss)
here we are using "ssss" variable for enter username in the login page
type(formfield1, ${ssss})

Tuesday, August 16, 2011

how to export or take backup mysql database from command promprt in windows

find your mysql location where you installed

C:\Program Files\MySQL\MySQL Server 5.0>

then move to bin folder

C:\Program Files\MySQL\MySQL Server 5.0\bin>

then use this comand

mysql --user=root -proot testdb > export.sql

this will create export.sql file in the bin folder.

if you want to save backup file in the specific path then you give like that

mysql --user=root -proot testdb > d:\db_backup\export.sql

Wednesday, August 3, 2011

How to add 'Selenium IDE in firefox'



How to add 'Selenium IDE in firefox'

Open firefox ( firefox version should be morethan 3.5 v)
move to 'http://seleniumhq.org/download/'
download ide ( click on download version ) and click 'allow' for allowing popup.
restart firefox
move to 'Tools > Selenium IDE'

you can add selenium ide from this page also 'https://addons.mozilla.org/en-US/firefox/addon/flow-control/'

you can add selenium ide from  'Tools > Addons > get addon' > search for selenium and install then restart firefox

Run Selenese Directly Within the Server Using -htmlSuite

Run Selenese Directly Within the Server Using -htmlSuite

 You can run Selenese html files directly within the Selenium Server by passing the html file to the server’s command line. For instance:



java -jar selenium-server-standalone-.jar -htmlSuite "*firefox" "http://www.google.com" "c:\absolute\path\to\my\HTMLSuite.html" "c:\absolute\path\to\my\results.html"


This will automatically launch your HTML suite, run all the tests and save a nice HTML report with the results.


Installing TestNG on Eclipse

Installing TestNG on Eclipse
follow the simple steps below to install the TestNG plug-in on the eclipse IDE.

  • Open the Install/Update window from Help->Software Updates->Find and Install
  • Click on the radio button "Search for new feature to install" and click "Next" button
  • Click on the "New remote site..." and supply name as "TestNG" and URL as "http://beust.com/eclipse" and click on "OK"
  • Make sure the TestNG is checked and click on the "Finish" Button
  • Now follow the other steps and TestNG will be installed.

Monday, May 30, 2011

How To start Selenium



Follow the below steps:

1. Recode your steps in Selenium IDE

2. Have to convert to java code and paste in the eclipse

3. change the class name like sasidhar and save as sasidhar.java.

4. Start the selenium server

5. Execute your script in sclipse.
================================================
package com.example.tests;

import com.thoughtworks.selenium.*;
import java.util.regex.Pattern;

public class sasidhar extends SeleneseTestCase {
    public void setUp() throws Exception {
        setUp("http://www.google.com/", "*firefox");
    }
      public void testNew() throws Exception {
          selenium.open("/");
          selenium.type("q", "selenium rc");
          selenium.click("btnG");
          selenium.waitForPageToLoad("30000");
          assertTrue(selenium.isTextPresent("Results * for selenium rc"));
    }
}
============================================

Thursday, March 10, 2011

MYSQL

How do you start and stop MySQL on Windows?  - net start MySQL, net stop MySQL


What’s the default port for MySQL Server? - 3306


What does tee command do in MySQL? - tee followed by a filename turns on MySQL logging to a specified file. It can be stopped by command notee.


Use mysqldump to create a copy of the database? - mysqldump -h mysqlhost -u username -p mydatabasename > dbdump.sql