title: SAPUI5 OPA Test - Message box - Error
body: <p>I am facing issues while pressing different buttons on message-boxes on JavaScript views of my SAPUI5 application. Other item seems to work fine like inserting text in text boxes, pressing buttons, selecting a row of table, etc.</p>
  
  <p>I found out that every messagebox has a type/class like <code>sapMDialogSuccess</code> or <code>sapMDialogError</code> or <code>sapMDialogWarning</code>, etc. Do we have a similar type/class for <code>OK</code>, <code>Cancel</code>, <code>Abort</code> buttons (displayed on <code>MessageBox</code>)?</p>
  
  <p>I am able to get exact text which appears on my <code>MessageBox</code> using:</p>
  
  <pre><code>ok(true, "This success message is displayed:- " +
  sap.ui.test.Opa5.getJQuery()(".sapMDialogSuccess").
  find(".sapMText").text());
  </code></pre>
  
  <p>But when I try following code to select (and then press) OK button, it does not work. Here is the code I am using:</p>
  
  <pre><code>//OK Button - Find &amp; Press OK button 
  Then.waitFor({
      pollingInterval: 5,
      searchOpenDialogs: true,
      controlType: "sap.m.Button",
  
      check: function(aButton) {
          if (aButton.text() === "OK") {
              return !!sap.ui.test.Opa5.getJQuery()(".sapMDialogSuccess").length;
          }
      },
      success: function() {
          ok(true, "OK button found - SUCCESS");
      },
      errorMessage: "OK Button not found - ERROR"
  });
  </code></pre>
  
  <p>Here is the error I am getting:</p>
  
  <pre><code>OK Button not found - ERROR
  Callstack:
      at Object.&lt;anonymous&gt; (http: //&lt;&lt;server&gt;&gt;:50000/XMII/CM/Opa-LineGroupMaintenance.html:152:22)
      at Object.f (https:// sapui5.hana.ondemand.com/sdk/resources/sap/ui/test/opaQunit.js:6:331)
      at Object.run (https:// sapui5.hana.ondemand.com/sdk/resources/sap/ui/thirdparty/qunit.js:11:9294)
      at eval (https:// sapui5.hana.ondemand.com/sdk/resources/sap/ui/thirdparty/qunit.js:11:11222)
      at C (https:// sapui5.hana.ondemand.com/sdk/resources/sap/ui/thirdparty/qunit.js:11:5918)
      at E (https:// sapui5.hana.ondemand.com/sdk/resources/sap/ui/thirdparty/qunit.js:11:6299)
      at eval (https:// sapui5.hana.ondemand.com/sdk/resources/sap/ui/thirdparty/qunit.js:11:6431)@ 3618 ms
  Expected:   
  true
  Result:     
  false
  Diff:   
  trufalse
  Source:     
      at Object.eval [as ok] (https:// sapui5.hana.ondemand.com/sdk/resources/sap/ui/thirdparty/qunit.js:11:20688)
  Script error.@ 3623 ms
  Source:     
  :0
  </code></pre>