Given a subgroup $G$ of $S_n$ by a generating set and an element $g in S_n$, we will discuss an efficient algorithms for testing if $g$ is in $G$. As a consequence, we will be able to solve a number of other algorithmic problems, e.g. solvability and nilpotence testing, random sampling from $G$.