@step('I will answer all prompts with "([^"]*)"')
def i_answer_prompts_with(step, prompt):
 (world.browser.execute_script('window.prompt = function(){return %s;}') % prompt)

@ step ( 'I will answer all prompts with "([^"]*)"' ) def i_answer_prompts_with ( step , prompt ) : ( world . browser . execute_script ( 'window.prompt = function(){return %s;}' ) % prompt )
please note: this method must be called right before an expected alert window variables are page local and thus all changes are removed upon navigating to a new page in addition .