This Section describes how to run your Test cases on different browsers.
Few Simple steps Using TestNG :)
Step 1: Create your Script. Using TestNG annotations. Define parameters (using @Parameters) for taking input value i.e, which browser should be used for Running the Test
Step 2: Create a TestNG XML for running your script
Step 3: Configure the TestNG XML for passing parameters i.e, to tell which browser should be used for Running the Test
Step 4: Run the TestNG XML which can pass the appropriate browser name to the Script such that the Test Case is executed in a specified browser
Programatically this can be Done as follows:
Step 1:
Step 2 & Step 3: The below XML is configured to run the Test Case in Firefox, Chrome and IE browser in sequential manner
Step 4:
Run the above XML as TestNG Suite from Eclipse IDE as shown below.
Few Simple steps Using TestNG :)
Step 1: Create your Script. Using TestNG annotations. Define parameters (using @Parameters) for taking input value i.e, which browser should be used for Running the Test
Step 2: Create a TestNG XML for running your script
Step 3: Configure the TestNG XML for passing parameters i.e, to tell which browser should be used for Running the Test
Step 4: Run the TestNG XML which can pass the appropriate browser name to the Script such that the Test Case is executed in a specified browser
Programatically this can be Done as follows:
Step 1:
package atu.multibrowser;
import
org.openqa.selenium.By;
import
org.openqa.selenium.WebDriver;
import
org.openqa.selenium.chrome.ChromeDriver;
import
org.openqa.selenium.firefox.FirefoxDriver;
import
org.openqa.selenium.ie.InternetExplorerDriver;
import
org.testng.annotations.AfterClass;
import
org.testng.annotations.BeforeClass;
import
org.testng.annotations.Parameters;
import
org.testng.annotations.Test;
public class MultiBrowserTest {
private WebDriver driver;
// Configure for multi
browser drivers
@Parameters("browser")
@BeforeClass
public void beforeTest(String
browser) {
if
(browser.equalsIgnoreCase("firefox")) {
driver = new FirefoxDriver();
}
else if
(browser.equalsIgnoreCase("chrome")) {
// Set Path for the
executable file
System.setProperty("webdriver.chrome.driver",
"D:\\chromedriver.exe");
driver = new ChromeDriver();
}
else if
(browser.equalsIgnoreCase("ie")) {
// Set Path for the
executable file
System.setProperty("webdriver.ie.driver", "D:\\IEDriverServer.exe");
driver = new
InternetExplorerDriver();
}
else {
throw new
IllegalArgumentException("The Browser Type is Undefined");
}
// Open App
driver.get("http://demo.opensourcecms.com/wordpress/wp-login.php");
}
@Test
public void login() throws InterruptedException
{
// Enter UserName
driver.findElement(By.id("user_login")).clear();
driver.findElement(By.id("user_login")).sendKeys("admin");
// Enter Password
driver.findElement(By.id("user_pass")).clear();
driver.findElement(By.id("user_pass")).sendKeys("demo123");
// Click on Submit
button
driver.findElement(By.id("wp-submit")).submit();
}
@AfterClass
public void afterTest() {
try {
driver.quit();
}
catch (Exception e) {
driver = null;
}
}
}
Step 2 & Step 3: The below XML is configured to run the Test Case in Firefox, Chrome and IE browser in sequential manner
<?xml version="1.0"
encoding="UTF-8"?>
<!DOCTYPE suite
SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite"
parallel="none">
<test name="FirefoxTest">
<parameter name="browser"
value="firefox" />
<classes>
<class name="atu.multibrowser.MultiBrowserTest"
/>
</classes>
</test>
<test name="ChromeTest">
<parameter name="browser"
value="chrome" />
<classes>
<class name="atu.multibrowser.MultiBrowserTest"
/>
</classes>
</test>
<test name="IETest">
<parameter name="browser"
value="ie" />
<classes>
<class name="atu.multibrowser.MultiBrowserTest"
/>
</classes>
</test>
</suite>
/***********************************************************************/
Enhancing your TestNG xml for running the Test Case on Different browsers Simultaneously. Speeding up the execution process :)
Using the feature provided by TestNG for Parallel Executions. Set the"parallel" attribute to "tests" so that the all the three browser tests can be executed Simultaneously.
<?xml version="1.0"
encoding="UTF-8"?>
<!DOCTYPE suite
SYSTEM "http://testng.org/testng-1.0.dtd">
<!--Change The Parallel attribute for parallel Execution-->
<suite name="Suite"
parallel="tests">
<test name="FirefoxTest">
<parameter name="browser"
value="firefox" />
<classes>
<class name="atu.multibrowser.MultiBrowserTest"
/>
</classes>
</test>
<test name="ChromeTest">
<parameter name="browser"
value="chrome" />
<classes>
<class name="atu.multibrowser.MultiBrowserTest"
/>
</classes>
</test>
<test name="IETest">
<parameter name="browser"
value="ie" />
<classes>
<class name="atu.multibrowser.MultiBrowserTest"
/>
</classes>
</test>
</suite>
This is one short and quick way of setting up Multiple Browser Testing :)
nice work :)
ReplyDelete:)
DeleteBig data is a term that describes the large volume of data – both structured and unstructured – that inundates a business on a day-to-day basis. big data projects for students But it’s not the amount of data that’s important.Project Center in Chennai
DeleteSpring Framework has already made serious inroads as an integrated technology stack for building user-facing applications. Corporate TRaining Spring Framework the authors explore the idea of using Java in Big Data platforms.
Spring Training in Chennai
The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training
Can we USE ur AUT reports for this test suite execution?????
ReplyDeleteHey AUT - I found this comes under suite folder thanks
DeleteIts ATU !!!
Delete#AT
is it possible to have 2 suite's in single xml file or i need to have separate for each set .
ReplyDeleteAccording to TestNG documentation, you can call multiple suite files in a single suite file.
Delete#AT
For Single test(I mean for single class inside the test), the above testng will work fine but not for multiple classes inside the test
ReplyDeleteexample:
Issue: Chrome browser stops execution once the Firefox opens
Example :
Deleteclasses>
class name="atu.multibrowser.MultiBrowserTest_1" />
class name="atu.multibrowser.MultiBrowserTest_2" />
/classes>
Note:I removed the "<" since I was not able to see after publish
Hi Pradeep,
DeleteThe post you referred explains more about multi browser tests - TestNG can also run methods in parallel. Please refer to TestNG documentaion.
#AT
For IE I am getting error:
ReplyDeleteorg.openqa.selenium.NoSuchElementException: Unable to find element with id == user_login (WARNING: The server did not provide any stacktrace information)
Seems that it's wrong locator for user_login field in IE. Open your website in IE and check path to this field.
DeleteI am get the same error when i launch 3 diff browsers like IE , FF , Chrome browsers the execution happens only on FF and rest of the two will be just still - hence we end up unable to find element errors. Btw I also checked that the locator is correct on IE / FF / chrome (its consistent).
DeleteAutomation Tester, good sample! Thank you =) How do you think, it will work with relative path to chromedriver.exe? I want to load my script to server and don't want care about strong path to drivers.
ReplyDeleteIt should work fine ! having the exe files relative to your project folder structure.
Delete#AT
Hi,
ReplyDeleteI'm getting below error , please help me on this.
Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones. Enable Protected Mode must be set to the same value (enabled or disabled) for all zones.
Thanks,
Anjaneyulu Vujani
you need to set the security zones to same (either checked or unchecked) in IE. Go To Internet Options, under security tab, set them to equal for all the zones.
Delete#AT
This information which you provided is very much useful for us.It was very interesting and useful for qa online training.We also providing qa online training institute in worldwide.
ReplyDeleteHi, am unable to run the suite,, can u help me please..
ReplyDeleteHow to get screenshot when we come across any failure in AUT report ?
ReplyDeletethanks for the steps. - Selenium Automation Testing Framework
ReplyDeleteThank you very much..i was keep on looking for this kind of example till evening, At last i got it thank you very much..
ReplyDeleteGreat Explanition
✔ PLC Training in chennai
ReplyDelete✔ PLC Training Institute in chennai
✔ PLC Training Center in chennai
✔ PLC Training Course in chennai
✔ PLC Course in chennai
✔ PLC SCADA Training in chennai
✔ PLC Training Centre in chennai
✔ PLC SCADA Training Institute in chennai
✔ Best PLC Training in chennai
✔ Best PLC Training Institute in chennai
✔ DCS Training in chennai
✔ Automation Training in chennai
✔ Automation Training Institute in chennai
✔ Industrial Automation Training in chennai
✔ Process Automation Training in chennai
✔ Robotics Training in chennai
✔ Inplant Training in chennai
How to get screenshot when we come across any failure in AUT report ?
ReplyDeleteThank you. As you said short and quick. I would say it is awesome.
ReplyDeleteHi,
ReplyDeleteI am following the same method for performing Cross browser testing where
in the xml file i have mentioned parallel = "tests" and thread-count =
"3" but, the main problem what i am facing is say i have configured for 3
browsers (ff /ie / chrome) all the 3 browsers open and load the and URL but
only my FF browser will be performing the execution rest of the two
will not do anything. So could you please help me how to achieve
parallel execution.
BTW my browser versions are FF38.5 , IE 11 , Chrome49
Hi,
ReplyDeleteI have ran a cross browser scenario on FF, Chrome and IE. After execution while i try to view the report, I have spotted 3 runs out of which Run 1 and Run 2 are not displaying any content with error page displayed as "Your file was not found, It may have been moved or deleted."
Run 3 came up with the result of the execution of final browser among the three (Only the result of IE).
Can you please suggest a possible way by which i will be able to view the report of all the browsers (IE, Chrome and FF) using ATU?
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.
ReplyDeleteSelenium
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.
ReplyDeleteSelenium
how to run this sample ...please describe step by step
ReplyDeleteWell explained. Got to learn new things from your Blog on Appium.Appium training in chennai
ReplyDelete
ReplyDeleteVery informative ..i suggest this blog to my friends..Thank you for sharing
Selenium Training in velachery | selenium training and placement in chennai |Selenium Training in chennai
Hi,
ReplyDeleteThanks for providing sample project. :)
Nice Information about multi browser My sincere thanks for sharing this post Please Continue to share this post
ReplyDeleteSelenium Training in Chennai
really nice blog has been shared by you. before i read this blog i didn't have any knowledge about this but now i got some knowledge. so keep on sharing such kind of an interesting blogs.
ReplyDeleteselenium training in chennai
This is an awesome post.Really very informative and creative contents.Thanks to sharing these concept is a good way to enhance my knowledge. I like this site very much.I like it and help me to develop my knowledge very well.Thank you for this brief explanation....
ReplyDeletePython Training in Chennai | Best Python Training in Chennai | Dot Net Training in Chennai
PLC training in Cochin, Kerala
ReplyDeleteAutomation training in Cochin, Kerala
Embedded System training in Cochin, Kerala
VLSI training in Cochin, Kerala
PLC training institute in Cochin, Kerala
Embedded training in Cochin, Kerala
Best plc training in Cochin, Kerala
Hi, I am really happy to found such a helpful and fascinating post that is written in well understandable manner enhance me to learn quickly… Thanks.. Software Testing Training in Chennai | Selenium Training in Chennai
ReplyDeleteHi, I am really happy to found such a helpful and fascinating post that is written in well understandable manner enhance me to learn quickly… Thanks..
ReplyDeleteSelenium Training in Bangalore
This is a great post. I like this topic.This site has lots of advantage.I found many interesting things from this site. It helps me in many ways.Thanks for posting this again.I really like this topic. Python Online Training
ReplyDeleteLearn Python Online
Great posting with useful topics.Thank you.
ReplyDeleteAbinitio Online Training | Hadoop Online Training | Cognos Online Training
ReplyDeleteYou've made some good points there. I looked on the internet for more information about this
Mainframe Training In Chennai | Hadoop Training In Chennai | ETL Testing Training In Chennai
Hi,
ReplyDeleteI'm getting below error , please help me on this.
Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones. Enable Protected Mode must be set to the same value for all zones.
software testing training online
Great information thanks a lot for the detailed articleThat is very interesting I love reading and I am always searching for informative information like this.
ReplyDeleteOnline Robot Framework Training
Hello friends, my name is Rajat and I work as the head of digital marketing in Delhi. I am affiliated with many MNC’s Software developers. If you are talking about the best educational institution in Delhi,Webtrackker help me get the best educational institute in Delhi.we are you offering some best services in our institute.with 100% job offers are available .
ReplyDeleteBest Php Training Institute in Delhi
Php Training in delhi
php Training center in delhi
Best Java Training Institute in delhi
Best Java Training in delhi
java Training center in delhi
linux Training center in delhi
Best linux Training Institute in Delhi
linux Training in delhi
Web Designing Training center in delhi
Best Web Designing Training institute in delhi
Web Designing Training in delhi
Oracle Training Institute in delhi
Oracle Training in Delhi
Oracle Training center in Delhi
blue prism Training Institute in delhi
blue prism Training in Delhi
blue prism Training center in Delhi
Automation Anywhere Training center In delhi
Automation Anywhere Training Institute In delhi
rpa Training Institute in delhi
rpa Training in Delhi
rpa Training center in Delhi
hadoop Training center in delhi
Best hadoop Training institute in delhi
hadoop Training in delhi
I would like to say that this blog really convinced me to update my knowledge about the technology you talk about. Thanks,very good post.
ReplyDeleteSelenium Training Chennai
software testing selenium training
selenium testing training in chennai
Selenium Training in T Nagar
Selenium Training in OMR
I accept there are numerous more pleasurable open doors ahead for people that took a gander at your site.we are providing ReactJs training in Chennai.
ReplyDeleteFor more details: ReactJs training in Velachery | ReactJs training in chennai
Very impressive thanks for sharing
ReplyDeleteVMware Training in Chennai
DevOps Training in Chennai
DevOps Certification in Chennai
Excellent Blog. Thank you so much for sharing.
ReplyDeletebest react js training in chennai
react js training in Chennai
react js workshop in Chennai
react js courses in Chennai
react js tutorial
reactjs training Chennai
react js online training
react js training course content
react js online training india
react js training courses
react js training topics
react js course syllabus
react js course content
react js training institute in Chennai
This excellent website truly has all of the info I wanted concerning this subject and didn’t know who to ask.
ReplyDeleteJava Training in Bangalore
Advanced Java Training in Bangalore
Thank you for this informative blog
ReplyDeleteTop 5 Data science training in chennai
Data science training in chennai
Data science training in velachery
Data science training in OMR
Best Data science training in chennai
Data science training course content
Data science certification in chennai
Data science courses in chennai
Data science training institute in chennai
Data science online course
Data science with python training in chennai
Data science with R training in chennai
ReplyDeleteYour info is really amazing with impressive content..Excellent blog with informative concept. Really I feel happy to see this useful blog, Thanks for sharing such a nice blog..
If you are looking for any Big data Hadoop Related information please visit our website Big Data Hadoop Training In Bangalore page!
Wow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.
ReplyDeleteDigital Marketing Certification Training
AWS Certification Training
Python Certification Training
Selenium Training
Data Science Certification Training
DevOps Certification Training
I like your more content. I'm read this article is such a nice blog.
ReplyDeletePython Training in Chennai
Python Training in Bangalore
Python Training in Hyderabad
Python Training in Coimbatore
Python Training
python online training
python flask training
python flask online training
Very interesting blog. Learn the automation testing concept very well.Many blogs I see these days do not really provide anything that attracts others, but believe me the way you interact is literally awesome.You can also check my articles as well.
ReplyDeleteDevOps Training in Chennai
DevOps Online Training in Chennai
DevOps Training in Bangalore
DevOps Training in Hyderabad
DevOps Training in Coimbatore
DevOps Training
DevOps Online Training
Wow I can say that this is another great article as expected of this blog.Bookmarked this site.Thanks for sharing.Keep sharing more blogs like this.
ReplyDeleteIELTS Coaching in chennai
German Classes in Chennai
GRE Coaching Classes in Chennai
TOEFL Coaching in Chennai
spoken english classes in chennai | Communication training
I just got to this amazing site not long ago. I was actually captured with the piece of resources you have got here. Big thumbs up for making such wonderful blog page!
ReplyDeleteArtificial Intelligence Training in Chennai
Ai Training in Chennai
Artificial Intelligence training in Bangalore
Ai Training in Bangalore
Artificial Intelligence Training in Hyderabad | Certification | ai training in hyderabad
Artificial Intelligence Online Training
Ai Online Training
Blue Prism Training in Chennai
There's no indication that's the case. Looking at Twitter's public repositories on Github , Scala is still, by far, the most common language used. ... stuhood: Twitter is not moving away from Scala. Scala continues to grow at a faster rate internally then any other language, and is ~50% of Twitter's backend codebase.
ReplyDeleteJava training in Bangalore
Java training in Hyderabad
Java Training in Coimbatore
Java Training
Java Online Training
Nice post. Thanks for sharing! I want people to know just how good this information is in your article. It’s interesting content and Great work. nice to read.
ReplyDeleteselenium training in chennai
selenium training in chennai
selenium online training in chennai
selenium training in bangalore
selenium training in hyderabad
selenium training in coimbatore
selenium online training
selenium training
nice post
ReplyDeleteSoftware Testing Training in Chennai | Certification | Online
Courses
Software Testing Training in Chennai
Software Testing Online Training in Chennai
Software Testing Courses in Chennai
Software Testing Training in Bangalore
Software Testing Training in Hyderabad
Software Testing Training in Coimbatore
Software Testing Training
Software Testing Online Training
Thanks for one marvelous posting! I enjoyed reading it; you are a great author. I will make sure to bookmark your blog and may come back someday. I want to encourage that you continue your great posts.
ReplyDeleteoracle training in chennai
oracle training institute in chennai
oracle training in bangalore
oracle training in hyderabad
oracle training
oracle online training
hadoop training in chennai
hadoop training in bangalore
This information which you provided is very much useful for us.It was very interesting and useful..
ReplyDeleteAWS Course in Chennai
AWS Course in Bangalore
AWS Course in Hyderabad
AWS Course in Coimbatore
AWS Course
AWS Certification Course
AWS Certification Training
AWS Online Training
AWS Training
Thanks for sharing great information in your blog. Got to learn new things from your Blog . It was very nice blog to learn.
ReplyDeleteacte chennai
acte complaints
acte reviews
acte trainer complaints
acte trainer reviews
acte velachery reviews complaints
acte tambaram reviews complaints
acte anna nagar reviews complaints
acte porur reviews complaints
acte omr reviews complaints
Thank you for the informative post. It was thoroughly helpful to me. Keep posting more such articles and enlighten us.
ReplyDeleteWeb Designing Training in Bangalore
Web Designing Course in Bangalore
Web Designing Training in Hyderabad
Web Designing Course in Hyderabad
Web Designing Training in Coimbatore
Web Designing Training
Web Designing Online Training
I am reading your post from the beginning, it was so interesting to read & I feel thanks to you for posting such a good blog, keep updates regularly.
ReplyDeleteDigital Marketing Training in Chennai
Digital Marketing Course in Chennai
SEO Training in Chennai
Digital Marketing Training in Bangalore
Digital Marketing Training in Hyderabad
Digital Marketing Training in Coimbatore
Digital Marketing Training
Digital Marketing Course
Digital Marketing Online Training
thank you for the information. It is very useful and informative
ReplyDeleteangular js course in chennai
angular course in chennai
angular js online course in chennai
angular js course in bangalore
angular js course in hyderabad
angular js course in coimbatore
angular js course
angular js online course
Thanks for provide great informatic and looking beautiful blog, really nice required information & the things i never imagined and i would request, wright more blog and blog post like that for us. Thanks you...
ReplyDeletepython training in chennai
python course in chennai
python online training in chennai
python training in bangalore
python training in hyderabad
python online training
python training
python flask training
python flask online training
python training in coimbatore
Needed to compose you a very little word to thank you yet again regarding the nice suggestions you’ve contributed here.
ReplyDeleteCyber Security Training Course in Chennai | Certification | Cyber Security Online Training Course | Ethical Hacking Training Course in Chennai | Certification | Ethical Hacking Online Training Course |
CCNA Training Course in Chennai | Certification | CCNA Online Training Course | RPA Robotic Process Automation Training Course in Chennai | Certification | RPA Training Course Chennai | SEO Training in Chennai | Certification | SEO Online Training Course
Thanks for giving great kind of information
ReplyDeleteselenium online training Hyderabad
selenium online courses
ReplyDeleteExcellent Blog I like your blog and It is very informative. Thank you
Puppet Course Online
selenium online training
Linux Online Training
Awesome Blog!!! Thanks for it, it is more useful for us
ReplyDeleteAWS Training in Tambaram
AWS Training in Anna Nagar
AWS Training in Velachery
AWS Training in Tnagar
AWS Training in Porur
AWS Training in OMR
AWS Training in Chennai
data science training
ReplyDeletepython training
angular js training
selenium trainings
selenium trainings
ReplyDeletesql server dba training
Testing tool training
The Blog contains the effective and attractive information’s and thanks for the blog.
ReplyDeleteJava Training Institute in Chennai
JAVA Training Institute in Bangalore
abinitio training
ReplyDeletespark training
scala training
azure devops training
app v training
sccm training
nice post.devops training
ReplyDeletedevops online training
devops online course
Nice blog to read. Thanks.
ReplyDeleteFull Stack Web Development Course Online
Best Full Stack Web Development Course Online
Excellent blog and I really glad to visit your post. Keep continuing...
ReplyDeletefull form of csir
full form of tisco
full form of love
e v s full form
gnm full form
pfa full form
vc full form
what is the full form of ict
psb full form
nri college full form
Thank you for sharing such a useful article. I had a great time. This article was fantastic to read. Continue to publish more articles on
ReplyDeleteData Engineering Solutions
Data Analytics Service Provider
Data Modernization Services
Machine Learning Services
Come up with a great learning experience of Azure training in Chennai, from Infycle Technologies, the best software training institute in Chennai. Get up with other technical courses like Data Science, Selenium Automation Testing, Mobile App Development, Cyber Security, Big Data, Full Stack Development with a great learning experience and outstanding placements in top IT firms. For best offers with learning, reach us on +91-7504633633, +91-7502633633.
ReplyDeleteI started reading your post from the beginning, and it was quite interesting to read. I appreciate you providing such a nice blog, and I hope you continue to update it on a regular basis.
ReplyDeleteadvanced java online training
Simply try to say ones content material could as daze. This fathomability while your eloquent is extremely perfect and I could think youon an expert for this count. Google Earth Pro Free Key high-ecological components nearby close to than your settlement set aside in me to control off when your ongoing day have adequate confirmation to kid support changed by using fundamentally basically not pretty weblog message. thankful to you stacks loads of nearby near you ought to go upon the eye-getting amass the cycle wrapped up.
ReplyDeleteGood Night Quotes For Friends ... Part of me was wishing today would never end! Hanging out with you makes me feel young again. Good night friend of mine. I lookGood Night Friends Quotes
ReplyDeleteA great blog on multi browser testing using selenium software.
ReplyDeleteThe Bigg Boss Vote Online allows you to vote easily from anywhere.
ReplyDeleteslot siteleri
ReplyDeletekralbet
betpark
tipobet
mobil ödeme bahis
betmatik
kibris bahis siteleri
poker siteleri
bonus veren siteler
VA6L
betmatik
ReplyDeletekralbet
betpark
tipobet
slot siteleri
kibris bahis siteleri
poker siteleri
bonus veren siteler
mobil ödeme bahis
V7SE2E