I am trying to capture screenshot on iOS device when any of my test gets failed.
Problem statement : How to get behave scenario inside the after_step() method
Observed error :
HOOK-ERROR in after_step: TypeError: after_step() missing 1 required positional argument: 'scenario'
What I have tried :
- Initialise one global variable and assign the current scenario name from method called before_scenario()
- Diff methods provided by appium itself to perform screenshot action
- Screenshot is being taken but from automation suit sometime multiple tests gets failed then we should have screenshot should have easily distinguishable name
Let me know if you came across such a scenario and found clean solution.