Modified click and typetext method