It's a bit general claim, to say "instanceof is a bad practice". It depends on the requirements, technical limitations, personal taste etc.
However, it is a point worth considering. Sometimes it means someone missed an opportunity to use polymorphism. For example, if your code says
if (input instanceof x.y.test){
greeting = "hello from xy";
}
else if (input instanceof x.y.z.test){
greeting = "hello from xyz";
}
Then it might be nicer if each 'test' had a method 'greet()':
greeting = input.greet();
// where class x.y.test has public String greet(){return "hello from xy";}
// and class x.y.z.test has public String greet(){return "hello from xyz";}
I say might, because it has a strong advantage: people can now add lots of other 'test' implementations, and your main code will accept them seamlessly without having to add 'if-else'.
However, it might also have disadvantages: if you feel it's wrong for your 'test' class to be responsible for the greeting calculation; or if it's a 3rd party outside your control. That's why I'm against generalizations.
There are more elaborate solutions - e.g. lookup the 'visitor' design pattern.