fetch

How to Find Xpath in IE Browser for Selenium WebDriver



Sharing buttons:

a hybrid welcome back to learn -

Automation calm this is Mukesh today we

will see how to find expat in a browser

so in Firefox we have some default

plug-in Firebug and fire path and it is

very easy to generate XPath in Firefox

but when you talk about I browser and

Chrome browser

we don't have any plugins today I found

a very new add-on which is called MRI

using this MRI you can write and weld it

whether this XPath is correct or not so

you can also check you can get the

element property using developer options

if you press S Curl you will get the

developer option you can check the

element property but if you need to weld

it whether this XPath is correct or not

whether it's matching with single load

or multiple node you can use this MRI

now let me show you what exactly this

MRI is so this is the URL for MRI MRI is

nothing but a bookmarklet for Internet

Explorer 6 plus and using I 11 something

not wrong it is 11 so even if you are

running i7 8 9 10 it will work so this

bookmarklet will work for Mozilla Safari

any browser so it's very easy to use

what you need to do as the instruction

says you need to drag this to your book

bookmark bar then load any web page and

hit the MRI bookmark and select any

field so I will show you this is the

Google let's say I want to validate I

want to identify this buttons and maybe

I will open Facebook as well so

first of all you just right-click here

and you can see right now you wish you

will not have any bookmarklet bar here

so right click and just check this

checkbox favorite bar so if it is bar

and just drag and drop this MRI to this

particular so now it will ask you do you

want to add this bookmarklet so say yes

no no it will be added here now let's

say I want to inspect any let's talk

about this first I want to verify or I

want to write XPath for this so I will

just click on this MRI this option will

come so if I using this first time now

it will at first time it will ask you do

you want to allow this so yes say allow

then next time if we click on MRI this

small boxing box will come and now you

can see it will ask you in turn selector

and click MRI says the fly will just say

double slash input and you can see if I

say input it is highlighting 11 matching

notes so it is matching almost every

button located let me be very specific

so if I right-click on this and if I

right click and say inspect element let

us know let me get the default property

first so if I rightly inspect element

and I want to write something on this so

you can see I have a property called

name equal to Q now if I want to verify

whether this XPath which I will write

will it work or not so I will just write

double slash input at the rate name

equal to Q so you can see it's

highlighting this search bar and it is

saying one matching node correct so you

can see now we have a way to write the

expert in a browser now let me show you

one more thing if I simply search how

many links I have chicken seeds matching

almost 50 nodes all these links hidden

links also it is matching

let me show you in Firefox if a

right-click or just if I open this MRI

it will ask you do you want to show all

the content say yes now just open and

search for input box you can see all

this input box on writing but I will

search give me only input box which have

type equal to password you can see only

two password matching nodes right now

let me search input box which has type

equal to radio you can see it's matching

this to radio button male-female let me

search for check box so you can write

any XPath okay it's not like only simple

experts you can write you can write any

complex part and it will highlight the

web element okay check box is not

present here so there's the reason it is

torturing so you can write any expert

then it will weld it on so let me check

if I want to write something for this

email box so name equal to email right

now if I write XPath like just give me

one input web element we are named equal

to email you can see it's highlighting

this so if you're completely new to

XPath then I will recommend you to watch

my previous video where I have discussed

how to write X path and how to write

dynamic XPath part 1 part 2 and if you

do not want to use this MRI tool it's

fine you can right click inspect all

then you can write your custom X path

and then run your script

but that will be time-consuming before

running the script you want to verify

whether it's matching with single node

or not you can use this MRI tool I

started using an inch very easy now the

question comes how internal it works so

if you put a mouse around as you can see

it's giving very lengthy JavaScript

right

and if I rightly can show you the

property this is the JavaScript which

forcefully we will enable to any web

page so what it will do it will start

that MRI bookmarklet bar so that you can

weld it expand so internally this

javascript is running in the background

so I hope we will start using this MRI

it's very easy to use this drag-and-drop

here and just start this the only

problem with this MRI is it is not meant

for CSS so if you search for if you

write the complete CSS it might not work

because I tried only the expert part in

its working fine so hope this MRI will

work for you

in the next video I will show you how

you can find XPath in Chrome browser in

chrome browser we have different options

to write x plus we can use this MRI as

well plus we have two additional options

as well which you can use so in the next

video I will show you how you can write

x5 for Chrome browser sso of this video

help thank you so much for watching

please share subscribe this channel have

a nice day