title: How to extract text from <Strong> tag?
body: <p>I am using Protractor with Jasmine for e2e testing my application. I have to validate whether the message thrown by the application is correct or not. The message box is visible only for 10 sec.
  I tried using the ID but it didn't work.
  Error Message: "No element found using locator: By(css selector, *[id="Message1"])"
  Below is the HTML for the element:</p>
  
  <pre><code>   &lt;div class="alert alert-warning alert-dismissible ng-scope" role="alert" ng-if="message.error" id="Message"&gt;
  &lt;strong id="Message1" class="ng-binding"&gt;Please Enter Valid License Key&lt;/strong&gt;
  </code></pre>
  
  <p> 
  The above element is in a modal dialog. Full HTML for Modal Dialog is mentioned below: </p>
  
  <pre><code>     &lt;div class="modal-content" uib-modal-transclude=""&gt;
      &lt;div class="modal-header ng-scope"&gt;
          &lt;h4 class="modal-title ng-binding" id="modal-title"&gt;Register New License Key&lt;/h4&gt;
      &lt;/div&gt;
      &lt;div class="modal-body ng-scope" id="modal-body"&gt;
          &lt;form name="RegisterNewLicenseKeyForm" ng-submit="Register(objDs)" novalidate="" class="ng-pristine ng-invalid ng-invalid-required"&gt;
              &lt;div class="form-group"&gt;
                  &lt;label for="LicenseKey" class="ng-binding"&gt;License Key&lt;/label&gt;
                  &lt;textarea class="form-control ng-pristine ng-untouched ng-empty ng-invalid ng-invalid-required" rows="3" id="LicenseKey" name="LICENSE_KEY" ng-model="objDs.LICENSE_KEY" placeholder="License Key" ng-required="true" my-maxlength="500" tab-index="" ng-trim="false" required="required" style=""&gt;&lt;/textarea&gt;
              &lt;/div&gt;
              &lt;!-- ngIf: !RegisterNewLicenseKeyForm.$valid --&gt;&lt;div ng-if="!RegisterNewLicenseKeyForm.$valid" class="ng-scope"&gt;
                  &lt;form-response-message&gt;&lt;!-- ngIf: message.error --&gt;&lt;div class="alert alert-warning alert-dismissible ng-scope" role="alert" ng-if="message.error" id="Message"&gt;
      &lt;strong id="Message1" class="ng-binding"&gt;Please Enter Valid License Key&lt;/strong&gt;
  &lt;/div&gt;&lt;!-- end ngIf: message.error --&gt;
  &lt;/form-response-message&gt;
              &lt;/div&gt;&lt;!-- end ngIf: !RegisterNewLicenseKeyForm.$valid --&gt;
              &lt;div class="clearfix modal-footer1"&gt;
                  &lt;div class="pull-left"&gt;
                      &lt;button class="btn btn-primary ng-binding" id="Validate" type="submit" tabindex="2" ng-disabled="RegisterNewLicenseKeyForm.$submitted || !RegisterNewLicenseKeyForm.$valid" disabled="disabled"&gt;Validate&lt;/button&gt;
                  &lt;/div&gt;
                  &lt;div class="pull-right rightspace"&gt;
                     &lt;cancel-icon title="Cancel" type="button" name="Cancel" tabindex="3" ng-click="Clear()" class="ng-isolate-scope"&gt;&lt;div ng-class="{ &amp;quot;has-focus&amp;quot;: formName[name].hasFocus,
              &amp;quot;has-success&amp;quot;: formName[name].$valid,
              &amp;quot;has-error&amp;quot;: formName[name].$error.required &amp;amp;&amp;amp; formName.$submitted,
              &amp;quot;has-error-pattern&amp;quot;: formName[name].$error.pattern &amp;amp;&amp;amp; formName.$submitted,
              &amp;quot;is-empty&amp;quot;: !ngModel }" class="is-empty"&gt;
      &lt;button class="btn btn-link btnPad t2  ng-pristine ng-untouched ng-empty ng-valid ng-valid-required" id="btnCancel" type="button" title="" ng-model="ngModel" ng-required="" ng-readonly="" autocomplete="off" spellcheck="false" tabindex=""&gt;
          &lt;i class="fa fa-ban fa-2x " aria-hidden="true"&gt;&lt;/i&gt;
      &lt;/button&gt;
  &lt;/div&gt;
  
  &lt;/cancel-icon&gt;
                     &lt;close-icon title="Close" type="button" name="Close" tabindex="4" ng-click="Close()" class="ng-isolate-scope"&gt;&lt;div ng-class="{ &amp;quot;has-focus&amp;quot;: formName[name].hasFocus,
              &amp;quot;has-success&amp;quot;: formName[name].$valid,
              &amp;quot;has-error&amp;quot;: formName[name].$error.required &amp;amp;&amp;amp; formName.$submitted,
              &amp;quot;has-error-pattern&amp;quot;: formName[name].$error.pattern &amp;amp;&amp;amp; formName.$submitted,
              &amp;quot;is-empty&amp;quot;: !ngModel }" class="is-empty"&gt;
      &lt;button class="btn btn-link btnPad t2 ng-pristine ng-untouched ng-empty ng-valid ng-valid-required" id="btnClose" type="button" title="" ng-model="ngModel" ng-required="" ng-readonly="" autocomplete="off" spellcheck="false" tabindex=""&gt;
          &lt;i class="fa fa-times-circle fa-2x" aria-hidden="true"&gt;&lt;/i&gt;
      &lt;/button&gt;
  &lt;/div&gt;
  
  &lt;/close-icon&gt;&lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="clearfix"&gt;&lt;/div&gt;
          &lt;/form&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Below is the Protractor code that i tried.</p>
  
  <pre><code>describe('Click on login button', function() {
  
        it('should navigate to Home page', function()  {
  
          browser.get(URL);
          browser.sleep(1000);
          browser.manage().window().maximize();
  
      //Register New License Key      
          element(by.id('RegisterNewLicenseKey')).click();
          browser.sleep(1000);
          element(by.id('LicenseKey')).sendKeys('LISC010102'); 
          browser.sleep(1000);
          element(by.id('Validate')).click(); 
          browser.sleep(1000);
          var message=$('#Message1').getText();
          expect(message).toBe('Please Enter Valid License Key');
          element(by.id('Close')).click(); 
      //User Login  
          element(by.id('text_User_name')).sendKeys('admin');
          element(by.id('text_userPassword')).sendKeys('welcome');
          browser.sleep(1000);
          element(by.id('btnLogin')).click();
          var title = browser.getTitle();
          browser.sleep(1000);
          expect(title).toBe('Home');
  
       });
  
      });
  </code></pre>
  
  <p>Please suggest how to capture the text from 'Strong' Tag?
  Thanks in Advance.</p>