In IE you need to install insatll Bookmarklets.
STEPS FOR INSTALLING BOOKMARKLETS
1) Open IE
2) Enter approximately: empty in the address bar and press enter
3) In the "Favorites" main menu, select ---> Add Favorites
4) In the Add Favorites window, enter the name GetXPATH1.
5) Click the add button in the add favorite popup window.
6) Open the "Favorites" menu and right-click on the newly added favorites and select the properties option.
7) GetXPATH1 properties will open. Select the Web Document tab.
8) In the URL field, enter the following:
javascript:function getNode(node){var nodeExpr=node.tagName;if(!nodeExpr)return null;if(node.id!=''){nodeExpr+="[@id='"+node.id+"']";return "/"+nodeExpr;}var rank=1;var ps=node.previousSibling;while(ps){if(ps.tagName==node.tagName){rank++;}ps=ps.previousSibling;}if(rank>1){nodeExpr+='['+rank+']';}else{var ns=node.nextSibling;while(ns){if(ns.tagName==node.tagName){nodeExpr+='[1]';break;}ns=ns.nextSibling;}}return nodeExpr;}
9) Click OK. Press YES in the popup warning.
10) Add another favorite by following steps 3 through 5, Name this favorite GetXPATH2 (step4)
11) Repeat steps 6 and 7 for the GetXPATH2 that you just created.
12) Enter the following in the URL field for GetXPATH2
javascript:function o__o(){var currentNode=document.selection.createRange().parentElement();var path=[];while(currentNode){var pe=getNode(currentNode);if(pe){path.push(pe);if(pe.indexOf('@id')!=-1)break;}currentNode=currentNode.parentNode;}var xpath="/"+path.reverse().join('/');clipboardData.setData("Text", xpath);}o__o();
13) Repeat step 9.
You are all done!
Now, to get XPATH elements, simply select the element with the mouse. This is due to clicking the left mouse button before the element (link, button, image, checkbox, text, etc.) starts and drags it to the end of the element. Once you do this, first select your favorite GetXPATH1 from the favorites menu, and then select your second favorite GetXPATH2. On his item you will receive a confirmation, press the access button. Now open the notepad file, right-click and select the paste option. This will give you the XPATH of the item you are looking for.