QA · Testing · watir

Watir — Use of innerText method

Watir — Use of innerText method

code

require ‘watir’
ie = Watir::IE.new
ie.goto(“http://www.google.com/ncr”)
my_div = ie.element_by_xpath(“//div[@id=’gbar’]”)
puts my_div.innerText

Output:

Web Images Videos Maps News Shopping Gmail more ?Groups
Books
Scholar
Finance
Blogs
YouTube
Calendar
Photos
Documents
Reader
Sites
even more »

Advertisements

One thought on “Watir — Use of innerText method

  1. I just want to tell you that I’m very new to blogging and absolutely savored your website. Likely I’m want to bookmark your website . You absolutely have fabulous article content. Many thanks for sharing with us your blog site.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s