A special test electromagnetic field in the spacetime of the higher dimensional generally rotating NUT-(anti-)de Sitter black hole is found. It is adjusted to the hidden symmetries of the background represented by the principal Killing-Yano tensor.