Tag Archives: Parameterized Test

What is JavaScript?? Why to learn it for Selenium IDE?

All selenium commands are made in JavaScript .

 

Lap 1 :

Download and install EditPlus Text Editor   http://www.editplus.com/

Make Html document

Or use online editor

http://www.onlinehtmleditor.net/

 

 

Lap 2:

What is The <script> Tag?

Example:

 

<script>
alert("My First JavaScript");
</script>

<script>
document.write("<p>My First JavaScript</p>");
</script>

 

Paste above code in html file and open that file in browser to verify output.

When user open this file in browser, User get one alert box because of Javascript.

 

Lap 3:

** JavaScript Variables **

Two types: text and numbers

create one html file and paste following code into it.

<!DOCTYPE html>
<html>
<body>
<script>
var answer1="He is called 'Johnny'";
var answer2='He is called "Johnny"';
var pi=3.14;
var x=123;
var y=123e5;
var z=123e-5;
var cars=["Saab","Volvo","BMW"];
var person={firstname:"John", lastname:"Doe", id:5566};
var carname
document.write(answer1 + "<br>")
document.write(answer2 + "<br>")
document.write(pi + "<br>")
document.write(x + "<br>")
document.write(y + "<br>")
document.write(z + "<br>")
document.write(cars[2] + "<br>")
document.write(person.firstname + " " + person["lastname"] + "<br>")
document.write(carname + "<br>")
</script>

</body>
</html>

 

Lap 4:

**JavaScript Functions**

make one new HTML file and paste following code to know how functions works

<!DOCTYPE html>
<html>
<head>
<script>
function myFunction()
{
alert("Hello World!");
}
</script>
</head>

<body>

<button onclick="myFunction()">Try it</button>

<p>By clicking the button above, a function will be called. The function will alert a message.</p>

</body>
</html>

 

Lap 5:

**Calling a Function with Arguments**

 <!DOCTYPE html>
<html>
<body>

<p>Click the button to call a function with arguments</p>

<button onclick="myFunction('Harry Potter','Wizard')">Try it</button>

<script>
function myFunction(name,job)
{
alert("Welcome " + name + ", the " + job);
}
</script>

</body>
</html>

 

koders.com

open source code from the world’s leading open source repositories

 

Selenium is made of so many javascript functions

checkout this on above repository.

selenium-api.js 

 

 

How to Parameterized Test using xml file in testng ?

Check This site

how to parameterized test in TestNG using @dataprovider annotation ?

mapping of complex parameter types to a test method with  @DataProvider annotation

See example:

 public class ParameterizedLoginTest {

@Test(dataProvider = "parameterIntTestProvider")
 public void parameterIntTest(String UserName, String Password) {
 System.out.println("UserName " + UserName);
 System.out.println("Password " + Password);
 }

 //This function will provide the parameter data
 // Selenium framework - read the data from xls file and put it in Object array
 // rows - number of time test has to be repeated
 // cols - number of parameters in test data
 @DataProvider(name = "Data-Provider-Function")
 public Object[][] parameterIntTestProvider() {

 Object[][] data = new Object[3][2];

 data[0][0] = "UserName1";
 data[0][1] = "UserName1@123";

 data[1][0] = "UserName2";
 data[1][1] = "UserName2@123";

 data[2][0] = "UserName2";
 data[2][1] = "UserName2@123";

 return data;
 }
}

Run this and Checkout TestNG result pane

Now Add new tag in testng.xml


<test name="test3">
 <classes>
 <class name="testWordpress.ParameterizedLoginTest" ></class>
 </classes>
</test>

 

And run TestNG.xml and see testng HTML report

 

parameterized test

parameterized test



Pupunzi

For a better web

Tech

News and reviews from the world of gadgets, gear, apps and the web

VentureBeat

News About Tech, Money and Innovation

Digital Inspiration

Tips and tutorials around all things tech.

Thinkwareglobal's Blog

Just another WordPress.com weblog

Kenazari's Blog

Just another WordPress.com weblog

Richfowler1's Blog

Just another WordPress.com weblog

Romaicus's Blog

Just another WordPress.com weblog

botlaguduri

Just another WordPress.com site

chandanag89

Just another WordPress.com site

meghshetty

Just another WordPress.com site

digitalmediaexpert

digital media expert blog

Thinking in Silverlight

Silverlight/WPF/Windows 8 Store App

Different Journeys

Let's make life easier!

LAW RESOURCE INDIA

LEGAL RESOURCE CENTRE / COURT JUDGMENTS / LEGAL ARCHIVES

BookConnect

Promoting Indian language Books

Actively Lazy

Software, crafted with passion

SAPonPower

An ongoing discussion about SAP infrastructure

SAP Career

Your Career Mentor

hrsapcertification

Just another WordPress.com site

The secret product manager

Thoughts about product management, SUSE, Linux, ARM processors, Cloud, AIX, Power Systems, and other things that interest me

Sap Certification Material . Com

Quality store for sap software and courses

Simon Les Flex's Blog

SAP Process Integration Specialist - NOW WE CAN DO BETTER!

Oracle Technologies Primer

An Oracle Fusion Middleware and iPaaS blog!

Gilberto Holms

Java, Middleware, SOA Architecture Blog

The Skeleton

Java code skeletons, tips and pointers

J@n van Zoggel

integration, innovation & random technology stuff

The Pragmatic Integrator

Hints and tips from a pragmatic integration specialist

briskwalk

The pace of life..

Optimalbg's Blog

Just another WordPress.com site

IT Jobs in USA

Keep the track of this Blog if you are looking out for some good Opportunities to work in USA....

Referral Jobs | Right Place to Get a Job

Hurry you are one Click away to get a job - Fresher Jobs for 2012, 2013 fresher’s and also high paid jobs for well Experienced IT professionals on Referal jobs.

eccinternational.wordpress.com/

ISO Consulting | ISO 27001 | ISO 20000 | CMMI | BCM | GRI Sustainability Reporting & Assurance | eLearning | Trainings | Philippines

Michael Korn's Blog

Musings on Life, Career, Faith and Technology

WORKINGWITHQTP

Just another WordPress.com weblog

Solutions365

.net, WCF, Unity, IOC, SQL

SQA and Testers Blog

Just another WordPress.com weblog

Expertqtp's Weblog

Just another WordPress.com weblog

Sai Chamarthi

Experienced Testing Professional

saxenavinay

A great WordPress.com site

Suresh4qtp's Blog

Just another WordPress.com site

jonah95hill

This WordPress.com site is the cat’s pajamas

It's always something...

Just another WordPress.com weblog

Faculty of Information Technology - Lê Ngọc Tiến

Be Yourself! Simplify Our Goals! Nothing is Impossible!

Anti-Malware Testing

Thoughts on security product testing past and present

Methods & Tools

Practical knowledge for the software developer, tester and project manager