+91 - 7569397388, +91 - 7799071404

Selenium Online Training


Base (or) relative URL:-

It opens only home page

Absolute URL

It opens entire URL

Command : open

Valu:

It opens first absolute URL after that it will go for base url

Identifying objects in the application (Online Training Materials are providing SELENIUM real time training with placement assistance)                             

7 ways to identify objects

1.     Using ID

2.     Using name

3.     Using identifier

4.     Using link text

5.     By using X path

6.     Using CSS

7.     Using DOM

Tools fire fox = fire bug (add on)

IE = debug bar (add on)

Chrome = no tools required

Here but

Click install firebug

Firebut1.11.1 for F.F.17

Add to fire fox

Install now

Restart browser

By using ID

HTML = tag=

Attribute - properties of tab (name, color, )

Tags stand alone tag +

It doesn't have parent / root tag

Container tag- ex again contains some child tags init

Container tag contains some set of tag

ID = ID attribute value

Right click on object

Inspect element with firebug

Copy ID value

Post in IDE at target

Click on find

By using name:-

Name:

Right click on object

Inspect element with firebug

Copy name value

Paste in target in IDE

Click find

By using identifier:- identifier = name (or) ID attribute value

By using link text

Link = link test

= text link text is the text found with in the anchor tag

By using x path

Using  x path we can identify 99,99 objects

//tag name[@unique attribute name  = 'value']

X path

Absolute x path = if we write from root tag to the specified element for identifying related x path = we write syntax for only the particular tag for which we need to identify instead of writing from root tag

Ensure syntax

// input [ @class = wpp-search -button submit]

Ex 1 = //input [@ value = 'search'

Ex 2 = //input [@ ID ='q' or id=q

Ex 3 = //span [ @ class = 'gbts] kspm class = "g bts" > g mail

2 parent tag is used to identify when there is no unique attributes  in child tag

//p tag name [@ p unique attribute name = 'p value'] / child tag name

Ex // a [ id 'gb-23/span [2]

Row count is used when there are two same child tag s under parent tag

Ex // li [ @ class = 'submit']/input

Ex // div [@ id = 'form']/ form/ ul li [5] /input

Right click = show all available commands = asset elements present on particular elements

X path position

There is no standard syntax

<ol>

<li>

<li>

<li>

<a>

<spon>

<spon>

Ex // li [8 ] a/ span [2]

Ex //div span /a

If we want to locate any element in

Particular position then we go for

X path position

We must not use style  attribute because style attribute changes from one browser to another browser

Ex;- //img[@alt='login']x ido it doesn't identify because it has same attribute for another element also

4contains - text ----  //tagname[contains(text( ), "text value"]

                   Element --- //tagname [contains (@altname, 'value']

If we want to identify  cell in the table then we go for x path position

Ex :- // tr [3] /td[3]

If table border is visible then the syntax is  id = table_id .row index. Col index

Ex id= table 4.2.1 ex2- id= table 4.4.0.(or)

//table [@id= 'table4'] /tbody/tr[5] /td parent child

Ex// td [contains (text( ), 'for sale)]

//input [contains (@value, "search )]

5 starts with how to identify dynamic element with dynamic id by using xpath.

Syntax //tag name [starts -with (@alt name, 'starting text')]

Ex //input [starts. With (@id, 'U')] (Best SELENIUM training is offered by Online Training Materials)

Prev Next

Training Enquiry