Yeah, I didn't make that clear, I don't ask that in the interview, but with HR or the person recruiting for the firm (before any interviews). One time had a recruiter lead me to believe the salary on offer was upto $X, then after interviewing and negotiating salary, found they would only go so high as $X - $Y. I declined and no one was happy with that situation.
It does not have to be a detailed initial conversation, something as simple as "what is the salary range for this position, due to my current responsibilities and level I am looking for something in the range of x to y. Is that realistic?" HR will give you a yes or no, you say thank you and decide where to go from there.