JavaScript syntax for do..while statement is,
do {
code block to be executed
} while (condition);
and while statement is,
while (condition) {
code block to be executed
}
What you have written is not correct and confusing, hence I raised the question.
With regards to your Advance button, does it appear after you performed certain actions? Or is the button disabled and then becomes enabled? TC will execute the lines of code quickly, and your object may not appear in time, therefore you might need a delay or wait.
An Object can Exists, but it's property values Visible might be False. Meaning that it doesn't appear on screen. You can verify this using the Object Browser.