Install TestNG
1.
Launch the Eclipse IDE
2.
Navigate to
Help->Install new software
3.
In Install dialog window,
click “Add”
button.
4.
Type name as you wish, for
example :- “TestNG”
5.
Type “http://beust.com/eclipse/”
as location.
6.
Click OK.
7.
Just Click TestNG checkbox
8.
Press “Next”
button.
9.
Click “I accept
the terms of the license agreement”
10.
Click Finish.
11.
Restart Eclipse
Create testng Class
1.
Right click on your package ( for this example
package is p1)
2.
Select New-> Others->testing class
3.
Enter name of the class ( for this example name
is testng1)
4.
Click OK
5.
Copy paste below code in the opened class
package p1;
import
org.openqa.selenium.WebDriver;
import
org.openqa.selenium.firefox.FirefoxDriver;
import
org.openqa.selenium.ie.InternetExplorerDriver;
import org.testng.Assert;
import
org.testng.annotations.Parameters;
import
org.testng.annotations.Test;
public class testng1 {
WebDriver
driver;
@Test(groups = {"Regression"},priority = 2)
@Parameters({"Browser1","url1"})
public void test1(String
sBrowser,String url) {
if (sBrowser.equalsIgnoreCase("firefox"))
{
driver=new FirefoxDriver();
}
else if (sBrowser.equalsIgnoreCase("ie"))
{
System.setProperty("webdriver.ie.driver", "C:/imp/software/IEDriverServer.exe");
driver=new InternetExplorerDriver();
}
else
{
System.out.println("Invalid browser");
System.exit(0);
}
driver.get(url);
String sTitle=driver.getTitle();
System.out.println("Title is "+ sTitle);
Assert.assertEquals("idojfioe", sTitle);
driver.close();
}
@Test(groups = {"Smoketest"},priority = 1)
@Parameters({"Browser2","url2"})
public void test2(String
sBrowser,String url) {
if (sBrowser.equalsIgnoreCase("firefox"))
{
driver=new FirefoxDriver();
}
else if (sBrowser.equalsIgnoreCase("ie"))
{
System.setProperty("webdriver.ie.driver", "C:/imp/software/IEDriverServer.exe");
driver=new InternetExplorerDriver();
}
else
{
System.out.println("Invalid browser");
System.exit(0);
}
driver.get(url);
String sTitle=driver.getTitle();
System.out.println("Title is "+ sTitle);
driver.close();
}
}
Create TestNG xml file
1.
Right click on your Project
2.
Select New-> File
3.
Enter name of the file ( for this example name
is testing.xml)
4.
Click OK
5.
Copy paste below code in xml file
<?xml version="1.0"
encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM
"http://testng.org/testng-1.0.dtd">
<suite name="Suite"
parallel="false">
<parameter
name="Browser1" value="firefox"/>
<parameter
name="Browser2" value="ie" />
<parameter
name="url1" value="http://www.google.com"/>
<parameter
name="url2" value="http://newtours.demoaut.com" />
<test
name="Selenium-AutomationSuite">
<groups>
<run>
<include name="Smoketest" />
<include name="Regression" />
</run>
</groups>
<classes>
<class name="p1.testng1"/>
</classes>
</test>
</suite>
Run the Suite
1.
Right click on xml file(testing.xml)
2.
Navigate to Run as-> TestNG Suite
Thanks for sharing this Information, Got to learn new things from your Blog on SELENIUM.
ReplyDeleteRef link : http://thecreatingexperts.com/software-testing-training-in-chennai/selenium-training-in- chennai/
Thanks for sharing this Information, Got to learn new things from your Blog on SELENIUM.
ReplyDeleteRef link :
http://thecreatingexperts.com/software-testing-training-in-chennai/selenium-training-in-chennai/
Thanks for sharing this Information, Got to learn new things from your Blog on Megento.
ReplyDeleteRef link : http://thecreatingexperts.com/magento-training-in-chennai/
Thanks for sharing this information.It was very nice blog to learn about Selenium.
ReplyDeletehttp://thecreatingexperts.com/software-testing-training-in-chennai/selenium-training-in-chennai/
Thanks for sharing great information in your blog. Got to learn new things from your Blog . It was very nice blog to learn about Selenium.
ReplyDeletehttp://thecreatingexperts.com/software-testing-training-in-chennai/selenium-training-in-chennai/
ReplyDeleteValuable information thanks for sharing HP ALM Online Training
A nice article here with some useful tips for those who are not used-to comment that frequently. Thanks for this helpful information I agree with all points you have given to us. I will follow all of them.
Selenium Training in Chennai
This is very informative blog and article thank you for sharing with us keep posting more information about salesforce trainingselenium training, selenium online training, selenium course,learn selenium course
ReplyDeletehttps://seleniumshiv.blogspot.in/2015/09/testng-selenium-webdriver-configuration.html
ReplyDeleteThanks for sharing great information in your blog.
ReplyDeleteSelenium training institute which provides Real Time Hands on Training…THE CREATING EXPERTS
http://thecreatingexperts.com/selenium-training-in-chennai/
contact-8122241286
Excellent Article ...thank u for sharing, such a valuable content Learners to get good knowledge after read this article.. Selenium Training in Chennai | Selenium Training in Chennai
ReplyDeleteHi, Excellent Content, your blog is very useful and also interesting to read. Keep sharing this type of information.
ReplyDeleteSelenium Course in Chennai
Selenium Courses in Chennai
Loadrunner course in Chennai
Best Loadrunner training institute in chennai
Qtp training institutes in chennai
Qtp training Chennai
Thanks for splitting your comprehension with us. It’s really useful to me & I hope it helps the people who in need of this vital information.
ReplyDeletePHP Training in Chennai
PHP Institutes in Chennai
PHP courses in chennai
PHP Training Chennai
PHP Course Chennai
This comment has been removed by the author.
ReplyDeleteIn the beginning, I would like to thank you much about this great post.
ReplyDeleteI like your writing style and I hope you will keep doing this good working.
Spoken English Institutes in Bangalore
Best Spoken English Class in Chennai
Spoken English classes in Chennai
Spoken English Chennai
English Classes in Chennai
Spoken English Course in Chennai
Spoken English Institute in Chennai
Nice post. I learned some new information. Thanks for sharing.
ReplyDeleteGuest posting sites
Education
The blog is well written. Thanks for your information.Java is fast, secure and reliable platform. there are lots of application and websites works under java and it is platform independant
ReplyDeleteBest Institute for JAVA
Best JAVA Training
JAVA Programming Certification Course
Best JAVA Certification
Best JAVA Training
Useful post.Thank you for sharing such an important data.Keep updating for this blog.
ReplyDeleteBig Data Hadoop Training in chennai Velachery
Big Data Hadoop Training in Tnagar
Big Data Hadoop Training in Nungambakkam
Big Data Hadoop Training in navalur
Big Data Hadoop Training in kelambakkam
Big Data Hadoop Training in karappakkam
I believe that your blog will surely help the readers who are really in need of this vital piece of information. Waiting for your updates.
ReplyDeleteTOEFL Classes in Chennai OMR
TOEFL Coaching Centres at Kandanchavadi
TOEFL Coaching Classes in Siruseri Chennai
TOEFL Coaching Classes near me
TOEFL classes in Moulivakkam
Best TOEFL Training Institute at Porur
IELTS Classes near Chennai Tambaram
Nice post. By reading your blog, i get inspired and this provides some useful information. Thank you for posting.
ReplyDeletePhotoshop Training Classes in Chennai
Best Photoshop Training in Chennai
Photoshop Course Training in Chennai
Photoshop Course
Photoshop Classes
Photoshop Training
Photoshop Classes for Photographers
Your blog is very useful to me. Explained perfectly and nicely.
ReplyDeleteIonic Course in Chennai | Ionic 2 Training | Ionic Framework Training | Ionic Course in Adyar | Ionic Course in Velachery | Ionic Course in Tambaram
Very informative article post. Really looking forward to read more. Will read on…
ReplyDeleteData Science Training in Vadapalani
Data Science Training in Chennai
Data Science Training in Chennai Velachery
Data Science Training in Tnagar
Data Science Training in Nungambakkam
Thanks for sharing this pretty post, it was good and helpful. Share more like this.
ReplyDeleteAWS Training in Chennai
AWS Certification in Chennai
AWS course in Adyar
Robotics Process Automation Training in Chennai
Blue Prism Training Chennai
UiPath Training in Chennai
Thanks for sharing such a information. It shows your in-depth knowledge. Pls keep updating.
ReplyDeleteHadoop Admin Training in Chennai
Hadoop Administration Training in Chennai
Hadoop Administration Course in Chennai
Hadoop Administration Training
Big Data Administrator Training
Hadoop Administration Course
Hadoop Admin Training Institutes in Chennai
ReplyDeleteThanks for sharing the fantabulous post. It gives immense pleasure to read your article. Your post is very thought provoking.
Pega training institutes
Pega training courses
Pega administrator training
Pega testing training
Pega software training
Pega software course
Pega training in Velachery
thanks for your artilce.its very helpful to my project.
ReplyDeleteSelenium training in chennai | Selenium training in velachery
I wanted to build my career in IT. Hats-off to the trainers at the training centre. They provide complete assistance and always ready to guide.
ReplyDeletecloud computing training institutes in bangalore
cloud computing training in bangalore
best cloud computing training institutes in bangalore
cloud computing training course content
cloud computing training interview questions
cloud computing training & placement in bangalore
cloud computing training center in bangalore
mmorpg oyunlar
ReplyDeleteinstagram takipçi satın al
tiktok jeton hilesi
tiktok jeton hilesi
antalya saç ekimi
referans kimliği nedir
İnstagram Takipçi Satın Al
Mt2 pvp serverler
instagram takipçi satın al
perde modelleri
ReplyDeleteMobil onay
Mobil Odeme Bozdurma
nft nasıl alınır
ankara evden eve nakliyat
trafik sigortası
DEDEKTÖR
web sitesi kurma
aşk kitapları
Good content. You write beautiful things.
ReplyDeletevbet
sportsbet
mrbahis
hacklink
vbet
sportsbet
hacklink
korsan taksi
mrbahis
dijital kartvizit
ReplyDeletereferans kimliği nedir
binance referans kodu
referans kimliği nedir
bitcoin nasıl alınır
resimli magnet
İ2MTQ
beşiktaş
ReplyDeleteeyüpsultan
gebze
marmaris
tekirdağ
KJF
https://saglamproxy.com
ReplyDeletemetin2 proxy
proxy satın al
knight online proxy
mobil proxy satın al
B3WQUD
adapazarı
ReplyDeleteadıyaman
afyon
alsancak
antakya
8RCD
https://izmitone.com
ReplyDeletekuşadası
sex hattı
HWHH