Micro Focus QTP (UFT) Forums
Dynamic obj rep - get text in the class (html) - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Dynamic obj rep - get text in the class (html) (/Thread-Dynamic-obj-rep-get-text-in-the-class-html)



Dynamic obj rep - get text in the class (html) - marcio cravo moreira - 05-26-2015

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?