TestNG Parametrisation – dataProvider

TestNG provides a way to get the data from external sources like from excel/textfile/arrays which helps to prepare data driven framework in automation. @Parameters – pass parameters from the testNG.xml @dataProvider – Pass the parameters as a 2D array. In this post, we will look into dataProvider @DataProvider This is another way of passing 2 dimensional array…

TestNG annotations

For the fundamentals of testNG framework and the testng.xml content, please refer to my prev blog post. selenium-testng (See all the available annotations) selenium testNGxml Let’s jump into a sample code to get more understanding on the annotations- These below 2 classes contains all the details of testNG annotations and the output shows sequence of execution…

Difference between driver.get() and driver.navigate()

driver.get(““) Will wait till the page loads completely with all controls in place. Used to get page source.              driver.getPageSource();         //returns the page source of current url that driver holds driver.navigate().to(““) Can navigate the page forward/backward driver.navigate().forward(); driver.navigate().back(); Used to refresh history.         driver.navigate().refresh(); To redirect a page will not wait till page loads…

Enhanced / advanced for loop in Java

————————————————————————————————————————- Enhanced for loop is applicable only for arrays, Arrays can be of int or string type… let’s see the old style of writing of for loop in java. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 public class ForLoop { public static void main(String[] args)…