The Wilcoxon Signed Rank test assumes that the population of interest is both continuous and symmetric (not necessarily normal). Since the mean and median are the same (for symmetrical distribution), the hypothesis tests on the median are the same as the hypothesis test on the mean.
The Wilcoxon test is performed by ranking the non-zero deviations in order of increasing magnitude (that is, the smallest non-zero deviation has a rank of 1 and the largest deviation has a rank of $n$). The ranks of the deviations with positive and negative values are summed.
These sums are used to determine whether or not the deviations are significantly different from zero. Wilcoxon Signed Rank Test is an alternative to the Paired Sample t-test.
$H_0: \mu = \mu_0\quad $ vs $\quad H_1: \mu < \mu_0$
Test Statistics: $T^-$: an absolute value of the sum of the negative ranks
$H_0: \mu = \mu_0 \quad$ vs $\quad H_1:\mu \ne \mu_0$
Test Statistics: $min(T^+, T^-)$
Because the underlying population is assumed to be continuous, ties are theoretically impossible, however, in practice ties can exist, especially if the data has only a couple of significant digits.
Two or more deviations having the same magnitude are all given the same average rank. The deviations of zero are theoretically impossible but practically possible. Any deviations of exactly zero are simply thrown out and the value of $n$ is reduced accordingly.