Jump to content

Recommended Posts

Posted

Sorry if that has been answered already but I am trying to get the value from this ul

<ul id="infolist">
 <li>
   <label> Number: </label>
    "&nbsp; 12345"
 </li>
<li>
   <label> County: </label>
    "&nbsp; CountyA"
 </li>
<li>
   <label> City: </label>
    "&nbsp; City1"
 </li>

 

What I want is the text from the label name and the text from that label

I have tried a few different ways but i am trying this code. 

 

_WD_FindElement($sSession,$_WD_LOCATOR_ByXPath,"//ul[@id='infoList']/li::text()[0]")

 

any help would be apperciated 

 

Posted

This is great thanks, it put me on the right track 

 

$infoList = _WD_FindElement($sSession,$_WD_LOCATOR_ByXPath,"//ul[@id='infoList']")
    $infoList_text = _WD_ElementAction($sSession, $infoList, 'property', 'innerText')
    $aOptions = StringSplit ($infoList_text,"  ", $STR_NOCOUNT)
    _WD_HighlightElement($sSession,$infoList,2)
    Sleep(250)
                _ArrayDisplay($aOptions)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...