--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users+unsubscribe@googlegroups.com.
To post to this group, send email to testng...@googlegroups.com.
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
@Parameters({"Environment"})
@Test(dataProvider = "returnTestcaseRow", priority = 1)
public static void main(String Environment, String flag, String TestCaseName)
{
try {
System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.Jdk14Logger");
EATradeCreation.CreationEATrade(Environment, flag, TestCaseName);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
@Test
public static void callScreen(String TestCaseName) throws Exception
{
while(true)
{
EAScreenshot.captureScreenShot(TestCaseName);
Thread.sleep(10000);
}
}
@DataProvider(name = "returnTestcaseRow")
public Object[][] EOT_testcasedata() throws Exception{
Object[][] testObjArray;
testObjArray = EOTdata.getTableArray(
"D:\\Automation\\EAAUTO\\src\\testData\\EOT_TestData_Updated.xlsx");
return testObjArray;
public class EAScreenshot {
public static void captureScreenShot(String TestCaseName) throws Exception {
Robot robot = new Robot();
BufferedImage screenShot = robot.createScreenCapture(new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()));
File dir = new File("D:\\TestResult\\"+ EOTMain.FOLDERNAME + "\\"+ TestCaseName);
dir.mkdir();
ImageIO.write(screenShot, "JPG", new File( dir + "\\"+System.currentTimeMillis()+".jpg"));
}
}
No. I dont think there is anything like that which you can use out of the box in TestNG.Reason is because, TestNG test method is just a bunch of java statements bundled together with one or more assertions.TestNG is aware of only the method, but what happens within the method is beyond TestNG's reach.If you would like to just build this capability, you need to be leveraging something like an EventFiringWebDriver (or) perhaps resort to the command executor approach.You can find more details about it in my blog post here : https://rationaleemotions.wordpress.com/2015/04/18/eavesdropping-into-webdriver/
Thanks & Regards
Krishnan Mahadevan
"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/My Technical Scribbings @ http://rationaleemotions.wordpress.com/
On Mon, Oct 30, 2017 at 4:05 PM, Kritika Gupta <kritika...@gmail.com> wrote:
I have written a code to take screenshot and to store the screenshots based on the test case name.I am calling this function before navigating to next page or before clicking on next button or submit or anyother button.I am using hybrid structure and converting my project to TESTNG.Is there any way or any annotation which will call screenshot function after each step in my method.
--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.
What do you intend to achieve with taking screenshots based on timers ? What is the usecase that you are trying to solve ?
Thanks & Regards
Krishnan Mahadevan
"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users+unsubscribe@googlegroups.com.
To post to this group, send email to testng...@googlegroups.com.
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "testng-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/testng-users/qE-aOWTueSk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to testng-users+unsubscribe@googlegroups.com.
To post to this group, send email to testng...@googlegroups.com.
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.