This question already has an answer here:
- Why is the Mann–Whitney U test significant when the medians are equal? 2 answers
- How to interpret Mann-Whitney's statistical significance if median is equal? 2 answers
- Reporting Results of Mann-Whitney U Test - Means vs Medians 2 answers
- What exactly does a non-parametric test accomplish & What do you do with the results? 5 answers
The straightforward null hypothesis for the Mann-Whitney U test is that the two distributions are identical. However, many documents (including Wikipedia) also indicate that it is equivalent for comparing the medians of two distributions.
Suppose that two distributions have the same shape, when the null hypothesis is violated, some shift in location exists between the two distributions. My question is that when there is a shift in location, not only median but also mean (and other distribution properties) are different between the two distributions. Why do we specifically say it is a test for median? Is it possible that when the null hypothesis is wrong, and still the means of the two distribution are the same?