Back To Normal

Subscribe To Our E-Mail Newsletter

Wednesday, December 14, 2011

How to connect Webdriver with IE explorer?

Below code will be usefull for you to connect IE with Webdriver.

DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();

capabilities.set(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,
true);

WebDriver driver = new InternetExplorerDriver(capabilities);


driver.get(sURL);
Read More


How to Integrate Selenium webdriver with eclipse?

1. Create Project in eclipse.


2. Right click the project and select Build Path --> Configure Build Path..

3. Import or Add all external jars to the Libraries .

     1. Add selenium standalone web driver jars

     2. Add Junit jars also..
4. Right click source (src) and create your own pacakges (TestSuite, utilities,Testcases..)

5. Start to write your own testcases in Java..
 public class TestacseName extends Testcase

{

               @setup
               @test
              @teardown

}
6.Run your tetsecase as ..

            1. Right click on Editer and select Run as Junit..

7. It will excuete java code on Browser.
Read More


How to read HtmlTable data by using Selenium Webdriver ?

public void ReadTableData(String sTableID)
{
WebElement table = driver.findElement(By.id(sTableID)));
// Now get all the TR elements from the table

List allRows = table.findElements(By.tagName("tr"));
// And iterate over them, getting the cells

for (WebElement row : allRows) {
List cells = row.findElements(By.tagName("td"));
for (WebElement cell : cells) {
Object CellValue = cell.getText();
System.out.Println("Cellvalue" +Cellvalue.toString )
}
}

}


Read More


Tuesday, May 31, 2011

Error Handling in RFT

Testcase Executon:
-------------------
Write your testcase (steps)scripts intoTry /catch blog to handle the exception to avoid the script termination.
  try
{
  // Testcode;
}
catch(Exception e)
{
logTestResult("test msg",fail);
}

Test Suite Execution :
-----------------------
try
{
callScript("Testcase1");
callScript("Testcase2");
}
catch(Exception e)
{
logTestResult("test msg",fail);
}



Read More


Wednesday, March 23, 2011

Re arrange the script Files in RFT

Before re arranging the scripts take the backup of all the scripts files and open the project in Eclipse. Now Change the project mode  from Functional Project to Java (In Eclipse find the option in right most corner)

Here user can drag and drop the script and suite files to new location and also move the resources file (map file,.rftdef and datapool ) to new location of resources folder.It will per mentally remove the moved files from the source location.

Advantages of drag and drop , will help to associate all helper class. No need to map any path in helper class.

Problem : Resource files are not mapped with script File because the script file path got changed.

         Open the “*.rftdef” xml from resource path and edit or change new location of the following files.
1.Script file 2. DataPool 3. Map file. After saving the file,Now try to acess the map and datapool from the script file. If you didnt change the path, it will throw as "File got corrupted or Not available."


Problem 2: when try to run the script file , it will throw error as ”Not able to read the script definition file.
           In helper class change the method input values. End of the helper class file user can find the “setScriptName” as function and change the path of the script Name in that method.
Read More


Friday, February 11, 2011

HTMLTABLE in RFT

Read More


Wednesday, February 9, 2011

Verification Point RFT

Verification points are used to compare the data or object properties verified dynamically or manually with the application.


Dynamic verification points

1. User can insert the verification point object under the "Verification Points."

2. Add the test object corresponding that object .

3. Add the following lines of code to verify the verification point dynamic.

    Example : vpDynamic("DynamicVP_01", TestObjectHere()).performTest();



In IBM sources are mentioned below lines of code verify the dynamically. But when I ran this code, its displaying the error.



vpDynamic("DynamicVP_01").performTest();



Manual verification points

Note : I am not sure how manual verification points will work, when try for my application its displaying the error message .

Below information sources are copied from IBM site.

Manual verification points are useful when you create the data for the verification point yourself, and you want to compare the data. For example, the data could be the result of a calculation or could come from an external source, such as a spreadsheet, data pool, database, or custom calculation.



Using the vpManual method



vpManual

("Object_01", "Check something manually.").performTest();

// or

vpManual

("ManualVP_01", "Check something manually.",

"Check something manually.").performTest();



The first time that a manual verification point is executed, if the verification point object doesn't exist, the value passed in will become the baseline value (which you can then see and edit in Rational Functional Tester, just like any other verification point). Your log file will say: Created verification point baseline.

From that point forward, any subsequent call to vpManual for that verification point will compare the actual point with the point. As Listing 5 shows, you can also call vpManual by passing in both the baseline and the actual result. In this case, the verification point object in Rational Functional Tester is ignored.

Read More


DataPool in RFT

Data Pool:

Definition : Data Pool is like excel where user can keep data , sql queries and logs.

Create Data Pool :

User Can create two types of data Pool in IBM RFT.

1. Select "Test Data pool" from the File --->> New .

2. Select the Working folder to place data pool location.

3. Enter the Data Pool name of the file.

4. click the Next button.

5. If u want to create empty data pool then click finish button . otherwise if you want to import data from other sources like CSV .. then click the browse button to specify the location of that file.

6. Specify the delimiter or separator like comma or space or tab..

7. Click the finish button.

It will create the data pool under the selected working folder.

Private Data Pool:

When user planning to keep private data pool for that test script. He can add the private data pool in the "Script Explorer".

Right Click the Test Data Pool and Add "Associate Data pool".

Export the Data Pool:

User can export the data pool data as CSV file. Select the Export from file menu or right click the data pool and select the "export " option.

Specify the File name and select the File Separator . Click the Finish Button to export the data.



Read the Data pool Data:

public ArrayList ReadDP(String DpName, String ColumnName) {

ArrayList DpContent = new ArrayList();
java.io.File dpFile = new java.io.File(

(String) getOption(IOptionName.DATASTORE), DpName);

IDatapool dp = (IDatapool) dpFactory().load(dpFile, true);
//Use default iterator class

IDatapoolIterator dpIter = dpFactory().open(dp, null);
//Use default equivalence class

dpIter.dpInitialize(dp);

dpIter.dpReset();

while (!dpIter.dpDone()) {

// Insert actions using dpIter based references to the datapool

//Get the current datapool record

dpIter.dpCurrent();
//Get the String value at column index 0 in current record

String str = dpIter.dpString(ColumnName);
DpContent.add(str);
//Move the pointer to next record
dpIter.dpNext();
}
dpFactory().close(dpIter);
return DpContent;
}

Read More


Sunday, January 30, 2011

Record PlayBack - RFT

  • Navigate to Script menu and Select "Add Script User Recorder" or click red color button in tool bar.
  • Enter the Script Name and click "Next ". Don't change any default option in window and click "Finish" button.
  • Started to perform action on the Application.
  • All the events are getting captured in the script playback window.
  • After performing the event , click the stop recording button .
  •  It will created the script file with "User entered name" under the project folder.
  •  script will be generated under with the objects captured at run time. this objects are referenced while re running the scripts.
  • To Re run the script -- Click the run button in tool bar
Record Event:

  •  User don't want to create the new file , he wants to add scripts into existing script file. For that select the "insert recording" from the script menu.
  • Perform the event in application and click the stop recording .
  • It will place the recorded script into the active script file , where user cursor is ponting.
Read More


560 Free Online Courses

Top 200 universities launched 500 free online courses.  Please find the list here .