title: With QTP11 descriptive programming, how do I verify an element is not present?
body: <p>I am a QTP neophyte.</p>
  
  <p>I'm able to write statements like this, using the Object Repository:</p>
  
  <pre><code>If Trim(DataTable.Value("ExpectedValue")) = "" _
    And Not Browser("MyApp").Page("MyPage").WebElement("MissingDataBanner").Exist  Then
      Reporter.ReportEvent micFail, "MissingDataBanner", "Element expected"
  End If
  </code></pre>
  
  <p>While I can use descriptive programming to check properties of elements that do exist...</p>
  
  <pre><code>If Not Browser("MyApp").Page("MyPage").WebElement("text:=" + DataTable.Value("ExpectedValue")).Exist Then
    Reporter.ReportEvent micFail, "My Data Field", "Element does not contain expected value"
  End If
  </code></pre>
  
  <p>when I try something like this:</p>
  
  <pre><code>If Trim(DataTable.Value("ExpectedValue")) = "" _
    And Not Browser("MyApp").Page("MyPage").WebElement("text:=" + DataTable.Value("ExpectedValue")).Exist  Then
      Reporter.ReportEvent micFail, "MissingDataBanner", "Element expected"
  End If
  </code></pre>
  
  <p>of course QTP can't find the web element, and the test errors trying to access the Exist method.</p>
  
  <p>Is there a way to use descriptive programming to check that an element does NOT exist on the page?</p>