Q.No1 How to Run Tests in Google Chrome
First Create a Project in eclipse
2nd create a package
3rd create a class
then past below code
package Automation;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class launchchrome {
public static void main(String[] arg)
{
System.setProperty("webdriver.chrome.driver", "E:\\study\\selenium\\chromedriver_win32\\chromedriver.exe");
WebDriver driver=new ChromeDriver();
driver.get("http://google.com");
}
}
Q.No.2 How to Run tests in Firefox Browser
First Create a Project in eclipse
2nd create a package
3rd create a class
then past below code
package Automation;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class launchfirefox {
public static void main(String[] arg)
{
System.setProperty("webdriver.gecko.driver","E:\\study\\selenium\\geckodriver-v0.25.0-win32\\geckodriver.exe");
// download gecko driver, gecko driver is use for firefox broswer
WebDriver driver=new FirefoxDriver();
driver.get("http://google.com");
}
}
What is TestNG ?
TestNg is a testing framework for java programming language created by cedric beust and inspired by Junit and Nunit.
Make test creation,execution and reporting efficient.
TestNg use annotation like
@BeforeTest @AfterTest
@BeforeClass @AfterClass
@BeforeSuit @AfterSuit
@BeforeMethod @AfterMetthod
How to install TestNG for Selenium ?
Open eclipse go help menu and click Install new Software option.
Click on add button option
Put TestNG on name Text box
And copy that url https://dl.bintray.com/testng-team/testng-eclipse-release and past in loaction option.
Click on Add button then It will search and show here.
click on checkbox which is show on. and click Next
After Next accept the agreement
Wait for the installation to complete.
You have installed TestNG successfully.
Why we use wait in selenium
the elements load time on a web page can vary, not all element are loaded at the same time. most of application are developed using JavaScript and ajax etc,object on web page may load at different time.
Implicit wait:- implicit wait in selenium is used to tell the web drive to wit a certain amount of time before it throw not such element exception. if once we set of time the web driver will wait for that time before throwing a exception
Explicit wait:- explicit wait in selenium is used to tell the web driver to wait a certain condition or maximum time to exceeded before throwing "elementnotfoundexception" exception.



Great Post with valuable information.I am glad that I have visited this site.Share more updates.
ReplyDeleteselenium training in OMR
selenium training in anna nagar
Java Training in OMR
Java course in Tambaram
DevOps Training in Anna Nagar
Digital Marketing Course in Anna Nagar
Software Testing Training in T Nagar
Graphic design courses in Porur
Web Designing Course in T Nagar
PHP Training in Chennai
ReplyDeleteThis article is a creative one and the concept is good to enhance our knowledge. Waiting for more updates.
selenium training in velachery
selenium training in tambaram
java training in tambaram
SEO Training in Anna Nagar
Software Testing Training in T Nagar
Python training in chennai
Android Training in OMR
Software testing training in Anna Nagar
RPA Training in T nagar
Web Designing Course in T Nagar
Thanku
DeleteHigh Technologies Solutions offers selenium training with choice of multiple training locations across Delhi. Further More Details Here-+91-9311002620 Or Visit Website- https://www.htsindia.com/Courses/Software-Testing/selenium-training-course-institute
ReplyDeleteThanks
DeleteWell Done...! it is very comprehensive and keep updaing here...
ReplyDeleteReactJS Training in Chennai
ReactJS Course in Chennai
PlC Training in Chennai
Thank you so much
DeleteThanks for sharing this kind of content in your blog its very helpful for me and you put very knowledgeable content if anyone search for best institute for selenium course check this out Contact Here-+91-9311002620 Or VisitWebsite-https://www.htsindia.com/Courses/Software-Testing/selenium-training-course-institute
ReplyDelete