How to pass variables in selectors

Thanks, but it does not find the element.

I have added a check to see if such an element exist and it fails everytime (while using ‘i’).
The same thing if I try to replace with exact number, the script runs successfully and the check return true.