 <p>You will need a new method which all it does it simply check if the radio button is there or not.</p> <pre><code>public static boolean isPrivateRadioButtonExist() { return driver.findElements(By.id("type-radio-private")).size() != 0; } </code></pre> <p>Then, in your base test class, call this method to determine if you need to skip the step or not.</p> <p><strong>However</strong>, the way you are approaching your problem is incorrect. If you have multiple versions of web app, then you should also have multiple versions of your automated tests. One way is to follow your web app's branching strategy. This will avoid yourself having to use all sorts of 'if' statements in your code.</p>