TestNG Interview Questions And Answers For Selenium WebDriver

Part 16

73 : How to gear upwardly priority of @Test method? What Is Its usage?

Answer : In your software spider web application's exam case, yous tin gear upwardly priority for TestNG @Test annotated methods every bit bellow.
@Test(priority=0)

Using priority, We tin control @Test method execution fashion every bit per our requirement. That means @Test method amongst priority = 0 volition hold upwardly executed 1st too @Test method amongst priority = i volition hold upwardly executed 2nd too and hence on. VIEW PRACTICAL EXAMPLE to know how to usage It.



74 : Tell me whatsoever v assertions of TestNG which nosotros tin usage In selenium webdriver software testing tool.

Answer : There are many dissimilar assertions available In TestNG but mostly I am using bellow given assertions In my exam cases.
  1. assertEquals VIEW EXAMPLE
  2. assertNotEquals VIEW EXAMPLE
  3. assertTrue VIEW EXAMPLE
  4. assertFalse VIEW EXAMPLE
  5. assertNull VIEW EXAMPLE
  6. assertNotNull VIEW EXAMPLE

75 : Can yous say me usage of TestNG Soft Assertion In selenium webdriver software testing tool

Answer : Using TestNG soft assertion, We tin maintain our exam execution fifty-fifty if assertion fails. That agency on failure of soft assertion, remaining purpose of @Test method volition hold upwardly executed too assertion failure volition hold upwardly reported at the halt of @Test method. VIEW PRACTICAL EXAMPLE.


76 : How to write regular facial expression In testng.xml file to search @Test methods containing "product" keyword.

Answer : Regular facial expression to find @Test methods containing keyword "product" Is every bit bellow In selenium webdriver software testing tool.
<methods>      <include name=".*product.*"/> </methods>

VIEW EXAMPLE OF USING REGULAR EXPRESSION

77 : Which fourth dimension unit of measurement nosotros render In fourth dimension test? minutes? seconds? milliseconds? or hours? Give Example.

Answer : Time unit of measurement nosotros render on @Test method degree or exam suite level Is In milliseconds.You tin VIEW FULL EXAMPLE to know how to gear upwardly fourth dimension out.
More interesting articles here :Generation Enggelmundus Internet Marketing Tool here :Zeageat IM http://www.software-testing-tutorials-automation.com/
Post a Comment (0)
Previous Post Next Post