I was speaking with a colleague of long-standing (an old friend). He's newly unemployed. He's been a tester for years, and for the last few years has been a developer. He'd like to keep doing development kinds of work, possibly creating automated tests or for a product. But he's resigned himself to being a tester.
I asked him what he wanted to do. "Oh, development. But no one will hire me for that." I asked why. "Because I was a tester for so long".
Your attitude around a potential job will shine through in an interview. If you would not hire yourself for a particular job, no one else will. Part of your job search is to manage your reactions to a potential job as you search. Some ideas about what you can do:
1. Know what you want to do. If you see a job you could do, but it's not what you want, reassess whether you want to investigate this job. If they hired you, would you work there? Sometimes the answer is "yes, because I'm broke." But more often, the answer is "Hmm, that's not really the right job for me."
2. If you're relatively new to a particular role, and you have a ton of experience in another role, make a list of all the reasons why your more junior role is the role for you. Go back to your resume and take a look at your accomplishments.
3. Use those accomplishments to explain your value to other people. Take the time to articulate your story of why you are valuable in your preferred job. My colleague has a bunch of stories to support how his testing expertise makes him an amazing developer, especially in a test-driven environment.
Your attitude about a potential job has a huge effect on an interviewer.