Home > Programming, QA, Test and Automation Stuffs > Search a attribute that contains a word in Selenium RC

Search a attribute that contains a word in Selenium RC

Hello,

Today I started post everything that I have learned in the work.

This time I will post the last thing and most usefully command that I learned.

selenium.getAttribute(“id=Element@style“).contains(“display: inline“)

You need to change the bold words, in the first word, you have to change the locator (id, xpath, class, name, link and others). After this you have to change the name of locator respectivally.

Just note that after the locator we have @style this is the attribute in the element that we will catch. Could be @class, or @title, anything and stay in the final of locator separates with @.

In contains, you can change for the tag you need find, like I want the element, whom style contains a display: inline, could be text=’something’ or value=’something’. Like this, simple doesn’t ?

Bye bye 🙂

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

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

%d bloggers like this: