 How many of you using x path almost everyone? So, do you guys face problem writing relative x path on a daily basis writing robust x path? How many? Ok. So, let us talk here. Let us see one scenario here to correlate this selector's problem on a daily basis. So, if we have to get the address of any place let us say without Google map how we used to get the address of any place we will be roaming here and there looking for someone who can help with the address of that location isn't it? If you don't have Google map so yesterday when I was coming here for this conference so I was I reached at the gate and I was not sure like where is the conference hall I asked one guy where is the conference hall? He told me sir just go straight take first right and then second right and there it is. So I reached this and that is how I reached conference hall and was attending all the conferences all the day. But what if next day one more cross has been introduced in between so now this conference hall will not be on the second cross it will be on the third cross. So, as we can see here there are like one, one, two, one, one, two, three something like indexes are there so this is like getting the address of any place which is something like absolute address which could be changed like the probability of changing that this address will is very high. So, in this case let's say tomorrow I will also have to update my memory that now conference hall is in the third cross and that guy who has helped me he will also have to update his database that now it's in third cross it's not in the second cross anymore. So similar situation we have similar kind of problem we have in our UI so to perform like talk here to perform any action here in the conference hall first I need the address of this place then I have to move my control like I will have to be here and then I can give the talk. So similarly in the UI if we have to enter the email address on this email box what all three things we need first we need the address of this email node then we will have to move our control over there and then we can enter the email address over there. So how we are doing it today either we are writing it manually or using the DAB tools right so let me show you let's see here using Chrome DAB tools how we get it just right click and copy x path but if we see here we have copied the x path but so far we haven't seen the value of the x path what it is whether this is relative or the absolute one let's paste it here so as we can see here it it has the indexes 1 2 something like that so chances are very high that it will change next time if any feature goes or any node comes in between so that like there will be like multiple locators will be there which we have in our script so all will respect to this will have to change all of them because all will get update with the indexes or else we will be writing our own relative x path robust one respect to the parent and all how proper solves this problem let's see with proper you just click on that DOM node or inspect the element it will give you the relative x path and copy button is there just in a single click you got the relative x path let's paste it here which doesn't have any indexes and we can directly use it in our script pro path helps generating relative x path absolute x path and CSS selectors sometime back like fire path and firebug has been deprecated in the new new version of firefox so I was facing problem like get while writing the script on firefox was not able to like first we have to verify it on chrome get the locators from the comb and then use it for firefox so from there I thought we'll add in support for fire firefox as well so now chrome pro path is supporting on firefox and chrome both so like so far everybody must be thinking like why we should use pro path like while we can write our own x path just by looking at the DOM it won't be like looking at looking at the DOM getting the tag and attribute unique attribute we can write simply so why to add one more add-on on our browser and then why should we go for this so let's see here one live demo let me let's see here how it helps us on a daily basis so here we have two test cases one is without pro path one is with pro path so if we have to enter the email address on the email box is it not visible so what I'm trying to hear is like on a daily basis we won't be changing the framework we won't be adding the framework level changes we just be adding the like test cases or writing the script so just to write this driver dot find element and by dot x path and then dot send keys it won't take much time now most of our time used to go in writing the locators if you see here this much writing the command for sending the keys sending the address email address on the box it has not taken much time now where we used to spend our most of the time in script so this is where like if we have to write the email address x path so how we will be doing it today so as we all know like we use the developer dev tools chrome dev tools here so how do we write it today so if we have to write the address relative x path for this email box what we will do will inspect this element and then from here we will be looking at the this node like input name and we will be thinking in mind somewhere back that which could be the unique attribute here so that we can use it in our script so how do we do that so let me start the timer here so that we can see how much time we are spending okay so just start the timer come back here here if I have to write so we will be writing like double forward slash input a address name is equal to let us say email I am thinking that this could be the unique but here we can see it's showing one of five so it's not the unique one then we will go for the like either some other attribute or we'll go for the parent one so less we'll go for the parent one there are multiple approach to write the relative x path but this is the like which we have seen mostly people using it so we'll go with this approach but still it's showing one of five we'll go with one more parent still it is one of five let me go with one more parent there are other locators as well like ID class if they are unique so now we got one of one so this we can use let me stop the timer here so it has taken me one minute three seconds so let's assume I was doing here and there it might have taken 15 to 20 seconds more but there are like easy locators as well this might be the little top of one so it has taken one minute time but if idea and class are unique then we can of course directly go with that but we have to write the locators for which we don't have unique so here it has taken one minute three second let me paste it in the script come back here now similar thing we'll see with the help of pro path so let's start the timer for pro path as well and we'll see how much time it will take with the pro path start to get the relative x path with the help of pro path we just have to click on this node just click on this node it has generated the relative x path here and click on copy button we can stop the timer here we'll go back to the script and we can paste it here so whatever we have written manually we got it with the help of pro path and we can see here how much time we have saved it though I was also explaining same thing for the pro path like how does it work and as we can see at least around 30 to 40 second you will save just for one locators this is when we are generating the x path or selectors similarly it also helps while while debugging the reports so most of the time how are what kind of errors we used to get in UI automation reports anyone any like what kind of exception we used to go get a lot like more frequently anyone no such element or timeout error or stale element something like that so always what are what is our first approach we used to go for like whether that element is present or not whether it is our script bug or actual UI bug so first of all we'll go and verify like looking for that element whether this is still present in the UI or not so let me show you here how we do it today like without pro path so let's say here in minthra.com for some let me write some random x path double forward slash h3 so here you can see so double forward slash h3 as soon as I typed it here it is scrolled to the window and highlighted that element and highlighted in the DOM now there are five matching node but we don't know which which are all those five nodes and now it's also not highlighting that there in the UI as well so we cannot figure it out which is that one as soon as you blink your eyes it gone from the there in the UI and here in the node in the dev tools we don't know which all five nodes will have to press enter or a scroll up and down to get all those five nodes so this is like jungling here and there and putting your head like which are all those fives let me show you similar scenario with pro path double forward slash h3 enter it's giving all five matching node in one tab itself and highlighting all those five element in the UI and as soon as you press enter it will scroll those all elements to the viewable area so here you have all five matching node extracted here and as we can see here like it says it has added attributes x path 1 2 3 4 5 so we know that this is the first matching node this is the second matching node this third one for fifth and as soon as you scroll on on top of mouse over on top of them the element will come into viewable area so we need not to worry about like where is that element is there somewhere hidden on the top or bottom or in the middle it will scroll for you and you will be easily getting to getting to know that this is the element for which I was looking for so if I would have started the timer here as well we could have seen like here also we are saving at least just for one element around 30 to 40 seconds of time and that's how here it is that's how it helps a lot and pro path also helps in generating absolute x path CSS selectors so you can get the all three and verify here x path and CSS selector both so this is why pro path here is the trust and the motivation and inspiration which I got from the which I which motivates me to work on this project currently 40,000 more than 40,000 developers are using in 116 countries and solving the problems of writing robust and relative x paths and selectors want to install it is very easy just search for pro path for Chrome open first link and click on add to Chrome and it's completely free you can add it and use it if you want it for Firefox it's available there as well just search for pro path for Firefox and it's very easy to there as well just open first link and click on add to Firefox it will add to your browser and you can use it so now it has solved your solves our problem and we have seen like is solving the problem of x path and selectors what next in pro path what could be the next in pro path it's already we are already verifying and generating the selectors any guess yes yes yeah so it's just ideas only if ideas there it will be giving you that with that tag name and at the rate idea attribute and that you can use of course if idea is there we need not to go there I'm assuming that you are using the parent structure to always find the unique path yes but there are multiple ways that you could traverse yes the entire path yes so you might find actually a sibling which is more unique yes and maybe your parent traversal gives you probably four or five levels yes so that's that's one thing that exactly exactly so here it is pro path 3.0 with a complete new UI which in the single page itself you will get all the relative x path absolute x path and CSS selectors and selectors staff you need not to change from x path to CSS and what he mentioned here it is what we are currently getting from pro path 2.0 is that from the child till like three four parents we have we were traversing and this is what we are gonna get from pro path 3.0 so directly it will be looking whichever will be the unique parent directly from there it will jump to the child one it will not be like we will not be having all those levels I can take the questions any query any feedback would be help love to help you I will be here how will you determine which would be the right selector for given element in a page so like if ID and class is there those are unique so it will immediately will write the x path with ID so you can directly use that ID value if any other attribute so like name or anything whichever will be the unique one it will give you the x path with that so directly you can just copy that value only you need not to go like if that will be if any attribute is not unique then only it will go for the traversing and writing the complete with the respect to the parent one so yeah so that's like we should know like whether you want to go with the selectors or x path it depends on the need because sometimes attributes are not there in that case what we will do we will be going for this if we if we want to go with like if you know that in the DOM CSS are there and selectors are there we can just select the selectors and you will get the selectors value from there thank you yeah sure if there is a unique dynamic ID then what is the possibility of the crew path so currently it is talking to the DOM which is the current DOM it's not it can't it's not that intelligent that it can think that this ID is the dynamic ID so if any ID is already there it will generate the relative x path with the respect of that ID it will not be thinking that this ID could be changed next time if you refresh the page that means it will not effective if there is a dynamic ID sorry if there is a dynamic ID it will give that particular ID based on that particular ID yes yes that's what like the logic behind is that currently it used to talk to the current DOM like if as in human being if I will be looking at the DOM and if I will find any ID immediately I won't be able to know whether this is ID is dynamic or not until it's not my application so yeah currently it's not I have one question like if we have a lot of iframes in our DOM can Cropath identify the elements inside the iframe yes so currently iframe with the current Cropath version is not supporting iframe but yeah in the Cropath 3.0 we have I have added the support that if any element is inside iframe we'll get to know that this element is inside iframe and means we can write it for time if we can write it manually but yeah in coming releases I'm adding I'm trying to add the support for iframe yes yes so it's there if you have anything let me show you it's already there for contents text so first if any element will be having the text or any attribute it will be generating on the basis of that like first of all it will go for attribute then it will go for the text and we'll try both the combinations and if that is not getting the unique then it will go for the parent one and then the up level this is Sam I have a question yes we are developing a product which is quite similar to what you have shown here yes so we have a record and play it not only records the expat but it also translates that into this case and executes it on the flight okay but we don't have a window like what you have shown here yes where you can just select copy paste right we don't have that feature but whatever the user does that translates that into a test case in a cloud-based tool so my question here is is this code available for everybody can we build on top of it is there a scope for collaboration yes yes so like some time back I have open source it I mean put it on git as public but I was doing some code refactoring so again I have made it private soon very soon I will be like pushing it public okay and it'll be available for everybody to it's in Chrome extension and fire path extension so sorry Firefox extension so it's like what is almost available there all right thank you so here you can see your question so here you can see it's having the attribute as well as contains text so it checked for the attribute if not then it's go for the text yeah so we'll just shop this questions from now as I'm just gonna be around yeah we just found two collaborators wanting to collaborate this is why we come to conferences meet people who are like minded and work together so you guys can meet again and I would like to see what you together bring up next so thanks a lot Sanjay for coming in about this you can write me any query anyone if any query has you can write me here on Twitter