added before/after methods

added before/after methods to resize and close the browser