I am working with selenium webdriver in python. I have a script:
if flag=='e':
try:
flag='e1'
login (user, passwd)
flag='e2'
my_script(data)
flag='e3'
I have this set up so that I can find out at what step any failure occurs at. This works fine for a small script, but if it was larger this would be difficult. I wondered if there is a way to execute a python command or block of code after each step in the script. so if the selenium scipt looked like:
step A
step B
step C
......
step Z
I could set flag = 0 and increment the flag after each step so that the effect is:
step A
flag = flag+1
step B
flag = flag+1
step C
flag = flag+1
......
step Z
flag = flag+1
Can this be done ? This is more of a general python question than selenium related although I would use it mainly in selenium.