selenium - Is TestNG's ITestResult Interface or a Class? if interface which class implemented this interface? -
selenium - Is TestNG's ITestResult Interface or a Class? if interface which class implemented this interface? -
is testng's "itestresult" interface or class? using below code take screenshot of webpage whenever there failure. getting status of test using itestresult. have checked testng's api , showing itestresult interface, class implemented interface? , how accessing method getstatus() using interface reference? can clarify doubt?
@aftermethod(alwaysrun=true) public void takescreenshot(itestresult result){ if(result.getstatus()==2){ itestngmethod instance = result.getmethod(); string testname = instance.getmethodname(); testutil.capturescreen("xyz", testname,"failure_screenshots");--> method take screen shot , save image file in specific directory } }
thanks in advance!!
org.testng.internal.testresult class implements itestresult interface. in eclipse, can click on type , click ctrl+t see type hierarchy info type.
selenium webdriver testng
Comments
Post a Comment