How to capture Screenshot

Hi All

I am new to mobile development, i am using nodejs for ios automation. i am not able to capture screenshot of failed test cases can you please help how to take a screenshot of failed test cases.

I am using

ios 9.2 simulator
Appium 1.5.3(Ara)

Thanks in advance
Prathyush R J

In java, it’s…

File srcFile = appiumDriver.getScreenshotAs(OutputType.FILE);

Full tutorial on getting screenshot on test failure from TestNg:

thank you for the reply, i was looking in javascript. I got few but it dint work, so trying for couple of options

Full tutorial on writing Appium tests in Javascript:

http://galenframework.com/docs/reference-javascript-tests-guide/

Taking a screenshot:

http://galenframework.com/docs/reference-javascript-tests-guide/#Takingscreenshot

1 Like

thanks @wreed, but it was throwing me error when i try to use screenshot function.