Custom Elements & Custom Locators with Selenium

Are you still using the standard WebElement?

Ok.. We will discuss about customizing selenium standard WebElement to your own type.

In this world you will have TextBoxes, Combos , Buttons and all.. even a big HTML table will be a single element.

So you will have a bunch of specific actions inside your customize element.


In Your Page Object.

@FindBy(how = How.ID, using = "myTable") public Table myTable;

In You Script

myTable.getCellText(3,4); //will return 4th item at 3rd column. myTable.getCellText("size",5); //returns 5th item of Size column .. wow! , you can write you're own action!

Is that All?

No! we will further discuss about Custom Locators as well!

It's your element! and you know the best way to locate it laughing

So if you need to do something beyond XPATH , you can write your own logic to locate your element.


Cheers! See you there at the session! wink

2 favorite thumb_down thumb_up 0 comments visibility_off  Remove from Watchlist visibility  Add to Watchlist

Outline/structure of the Session

  • Basics of WebElement
  • Bit about PageFactory
  • Implement your own FieldDecorator

Learning Outcome

By attending this session you can create your own custom element to make life more easier. Custom elements always encourage more re-usability.


Target Audience

Bit techy people

schedule Submitted 2 years ago

Comments Subscribe to Comments

comment Comment on this Submission