I want to put an if condition, when id="prog_bg" or class="progress_box_bg" is present then execute the remaining code. DOM is as below, 
<div id="wizard">
 <div class="quote_header">
 <div class="items">
      <div id="top-line" style="display: block;">
            <div class="back_box">
             <div class="progress_box">
                 <div id="prog_bg" class="progress_box_bg" style="width: 75px;"></div>
             </div>
             </div>
        <div id="service-div" class="page" style="padding-top:45px; >">
        <div id="propertytype-div" class="page">
I tried with lots of option but it won't work . Guys let me know how do it?
if (var.equals(driver.findElement(By.tagName("body")).getText().contains("prog_bg")))try { if (selenium.getHtmlSource().matches("^[\\s\\S]*prog_bg[\\s\\S]*$")) break; } catch (Exception e) {};if(driver.getPageSource().matches("^[\\s\\S]*prog_bg[\\s\\S]*$"))if(driver.findElement(By.id("prog_bg")).isDisplayed())if (driver.findElement(By.className("progress_box_bg")).isDisplayed())
Thanks, Sachin