views:

65

answers:

1

I have this html:

<div class="title">
<div class="subtitle">
<div id="flhcd1>
<h3>Hello</h3>
<span></span>
</div>
<div class="subtitle2">
</div>
</div>

I want to be able to use selenium and javascript to store the text in the <h3> (Hello) in the variable titleText .

I will be using this code in browsermob for monitoring tests.

+1  A: 

In BrowserMob you can do

var titleText = selenium.getText("//div[@id='flhcd']/h3");

and then use titleText like you would any variable.

AutomatedTester
Thanks, that is exactly what i was looking for.
chromedude