-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
screen shot - extent report issues #44
Comments
you can try with calling the method in afterstep hook with the if condition of scenario failure. |
Its the same with afterStep and after .. after it is screenshot after the scenario and afterstep aftwr every step but still soing the same attaching irrelavent screenshots |
Need to see the relevant code before commenting. Create a shared repository with the minimum code which produces the issue. |
hi sure will share it shortly, meanwhile the automated scrips are executed in browserstack , the cloud device platform - could that a reason at all? thanks |
hi @grasshopper7 , apologies i am unable to share the code, but was wondering if i am having issues as i am running 4 tests in parallel , abd is there a different way to create extent report with screenshots , while tests are run in parallel, instead of the way i have followed ? |
HI
I hope it is ok to ask for help here regarding screenshots attachment to extent reports.
I have the following screen shot code in my framework to attach screenshots :
this method in a base page or a geneneric methods class 👍
public static byte[] getByteScreenShot() throws IOException {
and i call this method in every cucumber steps class with below code to screenshot and attach for failed tests
@after
public void addScreenshot(Scenario scenario) throws IOException {
if (scenario.isFailed())
{
scenario.attach(BasePage.getByteScreenShot() , "image/png", ".png");}
this is taking screenshots fine but i notice that it is taking screenshot for every step instead of failed ones and are stored in screenshots folder as directed from extent.properties file.
but while attaching screenshots it is attaching irrelevant or wrong screenshots to the report.
is there a way to just take screenshot of only when test fails and not everystep ?
thanks
Poornima
The text was updated successfully, but these errors were encountered: