How to open a browser??
1.WebDriver driver = new Firefox Driver();
driver.get("http://gmail.com");
or
2.WebDriver driver = new FirefoxDriver();
driver.navigate().to("http://gmail.com");
Difference between driver.get("http://gmail.com") and driver.navigate().to("http://gmail.com");
1.driver.get();WebDriver will wait until the page has fully loaded (that is, the onload event has fired) before returning control to your test or script. It’s worth noting that if your page uses a lot of AJAX on load then WebDriver may not know when it has completely loaded. If you need to ensure such pages are fully loaded then you can use waits.
2.driver.navigate to:
History and Location
Earlier, we covered navigating to a page using the get command (driver.get("http://www.example.com")) As you’ve seen, WebDriver has a number of smaller, task-focused interfaces, and navigation is a useful task. Because loading a page is such a fundamental requirement, the method to do this lives on the main WebDriver interface, but it’s simply a synonym to:driver.navigate().to("http://gmail.com");To reiterate: navigate().to() and get() do exactly the same thing.
The navigate interface also exposes the ability to move backwards and forwards in your browser’s history:driver.navigate().forward(); driver.navigate().back();
1.WebDriver driver = new Firefox Driver();
driver.get("http://gmail.com");
or
2.WebDriver driver = new FirefoxDriver();
driver.navigate().to("http://gmail.com");
Difference between driver.get("http://gmail.com") and driver.navigate().to("http://gmail.com");
1.driver.get();WebDriver will wait until the page has fully loaded (that is, the onload event has fired) before returning control to your test or script. It’s worth noting that if your page uses a lot of AJAX on load then WebDriver may not know when it has completely loaded. If you need to ensure such pages are fully loaded then you can use waits.
2.driver.navigate to:
History and Location
Earlier, we covered navigating to a page using the get command (driver.get("http://www.example.com")) As you’ve seen, WebDriver has a number of smaller, task-focused interfaces, and navigation is a useful task. Because loading a page is such a fundamental requirement, the method to do this lives on the main WebDriver interface, but it’s simply a synonym to:driver.navigate().to("http://gmail.com");To reiterate: navigate().to() and get() do exactly the same thing.
The navigate interface also exposes the ability to move backwards and forwards in your browser’s history:driver.navigate().forward(); driver.navigate().back();




Hi guys ,I want to read complete data from excel file i tried writing the code but i am getting this following error.I have around 100 records & i want fetch all the data
ReplyDeleteException in thread "main" java.lang.UnsupportedOperationException: Not supported yet.
at javaapplication1.ExcelLibrary.getRowCnt(ExcelLibrary.java:20)
at javaapplication1.JavaApplication1.main(JavaApplication1.java:30)
Java Result: 1
So please help me out thank u guys
Hi Rohini,
DeleteIf you are using Apache POI then you can call method called getLastRowNum that will return u number of rows in excel.
You can run a for loop after that and perform the action based on your requirement.
K tthank u...but if i include a Excel library den its showing a exception as below
DeleteException in thread "main" java.lang.RuntimeException: Uncompilable source code - Erroneous tree type: javaapplication1.ExcelLibrary
at javaapplication1.JavaApplication1.main(JavaApplication1.java:30)
Java Result: 1.............so plz help me out
K tthank u...but if i include a Excel library den its showing a exception as below
ReplyDeleteException in thread "main" java.lang.RuntimeException: Uncompilable source code - Erroneous tree type: javaapplication1.ExcelLibrary
at javaapplication1.JavaApplication1.main(JavaApplication1.java:30)
Java Result: 1.............so plz help me out