Micro Focus QTP (UFT) Forums

Full Version: Dynamic obj rep - get text in the class (html)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I can not add the object in the object repository so I am trying to use the class.

I have the code below that is NOT working:
Code:
"Set a = Browser("Delta Dental of Washington").Page("Delta Dental of Washington").Object.getElementsByClassName(".coveo-omnibox-section .coveo-omnibox-selectable")"
"msgbox a"

I can inspect it in Chrome Console with:
Code:
"$(".coveo-omnibox-section .coveo-omnibox-selectable").first().text()"


My question:
I have:
Code:
<div class="alpha-selectable-box" style="display: block; width: 284px;">
  <div class="alpha-box">
    <div class="alpha-section">
       <div class="alpha-line">text 1</div>
       <div class="alpha-line">text 2</div>
       <div class="alpha-line">text 3</div>
       <div class="alpha-line">text 4</div>
1) How do I get the text?