TestNG framework annotations are very easy to understand and self-exploratory. You can find a lot of good tutorials to give you a good start! Below I am sharing some of the advanced things you can try for yourself while learning.
- TestNG groups can contain test methods in different classes. You will still be able to group them. Imagine you have a class A for test methods in one Page and class B for test methods in another page. You want methods in both pages to run in a batch. You can define the same group name for methods in both classes and test them together.
- You can create multiple Suites.xml files to create suites of test cases and run them using testng.xml. Suite.xml file will include suite, test, classes, groups, parameter tag like it usual. However testng.xml will look now include suite-files and suite-file tag.
- Cross Browser testing was something I was excited from day one. It didn't turn out to be as complex as I had expected. You just need to pass the browser name in parameter tag of your XML file and your@Before annotation method. That's pretty much it. Seems quite simple! Wait until you try it with Selenium 3.4.0 on Firefox and Internet Explorer. The latest version of selenium gives you all kinds of issues with Firefox and Internet Explorer is notorious for messing with web elements and it's slower speed. I recommend developing your multi-browser tests to run on Chrome and Microsoft Edge instead. You won't be caught into googling known issues and be able to focus on the topic at hand.
No comments:
Post a Comment