Dynamic XPath in Selenium using Different Approaches

Sdílet
Vložit
  • čas přidán 4. 07. 2024
  • Do you know how to write Dynamic xpath in Selenium Webdriver? In this video, we will mainly discuss XPath different methods which will help us to write Dynamic XPath while creating Selenium script.
    Please use below link for xpath
    learn-automation.com/how-to-wr...
    ~-~~-~~~-~~-~
    Please watch: "How To Create Maven build For Selenium Framework"
    • How To Create Maven bu...
    ~-~~-~~~-~~-~
  • Věda a technologie

Komentáře • 227

  • @karthickshiva2671
    @karthickshiva2671 Před 6 lety

    Once I thought I can never learn Selenium, now you are also one of the reason where i started automating some web pages. thanks brother you are awesome

  • @gnreddyk7866
    @gnreddyk7866 Před 7 lety +1

    Dear Mukesh,Investing your time to fulfill our minds with these concepts is Awesome task..We are grateful to your time..With folded hands ..thanks alot .

    • @Mukeshotwani
      @Mukeshotwani  Před 7 lety

      Your most welcome mate :) Kindly share with your friends too.

  • @aishwaryapathak553
    @aishwaryapathak553 Před 7 lety +1

    Hi Mukesh ,
    Just wanted to appreciate the way of teaching and explaining you do.
    I enrolled for selenium class room training but your online sessions proved to be more effective.
    Thanks

    • @Mukeshotwani
      @Mukeshotwani  Před 7 lety

      Hi Aishhwarya,
      Thank you so much :) I am glad it helped you. Keep visiting and Happy Weekend.

  • @mohammedmoosasharieff1816

    Thanks Mukesh...
    Wanted to learn writing xpath since months!
    The video has been helped a lot.

    • @Mukeshotwani
      @Mukeshotwani  Před 4 lety

      Thanks Moosa, I will glad you understood Xpath concept.

  • @rekham9489
    @rekham9489 Před 8 lety

    Very Nice and easy to understand....best tutorials. Thank You Mukesh Sir :-)

  • @siyarsahar9954
    @siyarsahar9954 Před 4 lety

    Dear Mukesh Thanks for all the videos you make! in 23 rd minute, you talk about if id is dynamic, so we use starts-with, but you forget to write starts-with and you write contains.

  • @ajaysuresh3781
    @ajaysuresh3781 Před 4 lety +1

    Thanks Mukesh. Your tutorials are really helpful and informative

  • @SouravGhosh-pb5nm
    @SouravGhosh-pb5nm Před 6 lety +1

    Thanks Mukesh. Very helpful.

  • @vamsi476giet
    @vamsi476giet Před 8 lety

    The most important thing in selenium is to find the element and thanks for explaining it in very detailed manner

  • @MyGreatAchievers
    @MyGreatAchievers Před 7 lety +1

    My hunt for XPATH ends here Mukesh...u r simply awesome.....Disappointed as there are only 29k views....deserves more...

    • @Mukeshotwani
      @Mukeshotwani  Před 7 lety

      Thanks Rao :) Views are less but user attention is high. Keep visiting

  • @pratikkhakria6319
    @pratikkhakria6319 Před 7 lety

    Wonderful Mukesh.
    This video is awesome.
    :)

  • @prc6075
    @prc6075 Před 6 lety

    Hi Mukesh
    What will be the xpath for getting the dynamic id of the radio button.
    Here i enter data (4 text boxes) and click on add button, the data is added and displayed with a radio button.
    If i add 2 times then 2 rows of data added with radio button for each row of data (e.g. radio0 and radio1).
    so to delete that row i have to selet radio button and click delete button.
    Now how to select radio1 and delete that row?? I tried with xpath but not able to do it.

  • @SagarKumar-rg8xc
    @SagarKumar-rg8xc Před 6 lety

    very well explained, good learning from you

  • @vrjosyula
    @vrjosyula Před 8 lety +1

    Thanks a lot Mukesh. This video cleared a lot of my doubts and gave a lot of insight.

    • @Mukeshotwani
      @Mukeshotwani  Před 8 lety

      +vrjosyula let me know if any help from my side.

  • @towhidskynet
    @towhidskynet Před 6 lety

    12:15, 16:00, 9:00, 20:50,25:00
    Very good examples of :
    1. how to see number of matching nodes
    2. use of and or logic
    3. use of text() and contains(), starts-with() method.
    4. use of following

  • @khyatisingh404
    @khyatisingh404 Před 3 lety

    Sir I love you !u have given me a solution thank you!

  • @sangeetham3533
    @sangeetham3533 Před 5 lety

    Hi mukesh, how can i compare string value and webelement in if condition ,suppose i want to compare actual and expected ,actual is string and expected is of type webelement.please suggest me

  • @saiputlur
    @saiputlur Před 7 lety +1

    thats very precise and clear explanation. easily understandable. thanks a lot.

    • @Mukeshotwani
      @Mukeshotwani  Před 7 lety

      Hey Krishna Thank you :) I am glad it helped you. Keep visiting.

  • @nikhiltinku3232
    @nikhiltinku3232 Před 4 lety +1

    Thankyou Mukesh, your videos are really helpful.

  • @najeebzahed6348
    @najeebzahed6348 Před 6 lety

    For the example you used on 16:27 here's the XPath I use able to use today:
    //td[@class='t posts']//a[contains(text(),'Posts')]

  • @ramgupta4567
    @ramgupta4567 Před 6 lety

    Nice video on Xpath.Thanks Mukesh

  • @PradeepChauhan17
    @PradeepChauhan17 Před 6 lety

    Very informative video. Thank you for this.
    Few questions: 1. (Ref:17:48) At some place you mentioned @name='value'. At another you mentioned @href, 'edit.php'. The = is not mandatory? Where all it's used?
    2. (Ref:17:40) How to find how many methods (like contains, text, etc.) are available?
    3. On FireFox 59 (Quantum) how do I per a search for the XPath ? Do I see a similar search box like I see in FireBug/FirePath which is incidentally not supported.

  • @chaitanya2590
    @chaitanya2590 Před 8 lety

    Video was very helpful , Thank you!

    • @Mukeshotwani
      @Mukeshotwani  Před 8 lety

      +Chaitanya G.A Your most welcome let me know if any help from my side.

  • @Iceeboltt
    @Iceeboltt Před 3 lety

    Hey Mukesh so what is wrong if we use the same xpaths why we need to customize xpaths what is the benefit in that for a tester ?

  • @chandanrai6302
    @chandanrai6302 Před 6 lety

    hi sir thanks for your video,please clear my one doubt if in web table duplicate name is available and unique transation id is available then how to verify the data on the basics of the transation id please let me know
    REPLY

  • @srinivastrully3789
    @srinivastrully3789 Před 6 lety

    HI Mukesh, Is XPATH value depends on the browser ? I have heard that, xpath found in FF is different to the one in IE; Is this true?

  • @LINGAREDDYSabbasani
    @LINGAREDDYSabbasani Před 7 lety

    Very good explanation thank you !!

  • @grijeshmnit
    @grijeshmnit Před 7 lety +1

    Thanks Very much. You saved my lots of time and efforts (y)

  • @seetalbachu758
    @seetalbachu758 Před 8 lety +1

    Very good tutorial. Easy to understand.

    • @Mukeshotwani
      @Mukeshotwani  Před 8 lety

      +Seetal Bachu Thanks Seetal keep visiting :)

  • @AJAUTOMATION
    @AJAUTOMATION Před 4 lety +2

    Brilliant job Mukesh..I have learnt a lot from you..
    #AjAutomation

  • @rd669
    @rd669 Před 7 lety +1

    very useful video. Thank you so much Mukesh!

  • @pinkisukhwani9600
    @pinkisukhwani9600 Před 7 lety +1

    Hi Mukesh,
    you are doing great ...!! can you pls make video on "Parameterizing xpath"

  • @asmarazaq9122
    @asmarazaq9122 Před 4 lety +1

    Thankyou Mukesh, it was really helpful

    • @Mukeshotwani
      @Mukeshotwani  Před 4 lety

      Most welcome Asma... keep learning.. Happy to see that you are learning over weekend 😃

  • @ppatel332
    @ppatel332 Před 6 lety +1

    Thanks sir. This video is really useful.

    • @Mukeshotwani
      @Mukeshotwani  Před 6 lety

      Welcome, Parthiv... Please keep visiting...

  • @MukeshKumar-iw7rr
    @MukeshKumar-iw7rr Před 6 lety

    Hi Mukesh, thanks for this video. Can you upload videos on how to find xpath for SVG and AngularJS as well.

  • @chinmayachittaranjanjena2575

    Good Tutorial, understood how to make xpath

    • @Mukeshotwani
      @Mukeshotwani  Před 8 lety

      +Chinmaya chittaranjan jena Thanks Chinmaya

  • @MdAlam-ie7fg
    @MdAlam-ie7fg Před 7 lety +1

    Hey, Mukesh thank you very much, its really helpful

  • @mykyramylife
    @mykyramylife Před 7 lety +1

    Thanks Mukesh, very useful.

  • @muthuvel2390
    @muthuvel2390 Před 7 lety

    hi mukash thanks for your video it is very helpful and i have one doubt if xpath values are changed dynamically interviewer asked that question so i dont know how to answer ths question so please.

  • @seemaahuja1750
    @seemaahuja1750 Před 7 lety +1

    Thanks a lot mukesh for this excellent vedio

    • @Mukeshotwani
      @Mukeshotwani  Před 7 lety

      +Seema Ahuja thank you Seema keep visiting and let me know if any help required from my side.
      Happy weekend

  • @abhisheknimbalkar8509
    @abhisheknimbalkar8509 Před 8 lety +2

    Thanks Mate... Xpath was never so easy to understand. Keep up the great work ...

    • @Mukeshotwani
      @Mukeshotwani  Před 8 lety

      +Abhishek Nimbalkar Thank you Abhishek :)

  • @lavanyaaparamanandham4088

    Hi Mukesh, I am new to selenium, I am practicing to write my own xpath in your blog. I am trying to mouse hover to automation tools tab, I am trying to create my own xath for that, but I am getting error. can you please help me action.moveToElement(driver.findElement(By.xpath("//a[contains(text(),'Automation Tools')]"))).build().perform();. the error I am getting is unable to locate element.

  • @atulthorat5670
    @atulthorat5670 Před 3 lety +2

    Thank you Mukesh..!

  • @siddeshwarmithbavkar4232
    @siddeshwarmithbavkar4232 Před 6 lety +1

    Really awesome!!

  • @and7998
    @and7998 Před 8 lety

    Awesome video! keep up the good work. Can you also upload a tutorial on how to work with s and windows handles in selenium?

    • @Mukeshotwani
      @Mukeshotwani  Před 8 lety

      +Anu Dube Hi Anu for frames will upload tomorrow. For window handle please refer below link.
      Note- Please use headphones for this video voice is very low.
      czcams.com/video/IcAD_eI50v8/video.html

  • @towhidskynet
    @towhidskynet Před 6 lety

    do you still have this workdpress site? if so, could you please post the link ? Thanks

  • @AbhishekGupta-kn8pv
    @AbhishekGupta-kn8pv Před 8 lety +1

    It was quite knowledgeable...waiting for another one..However I would request to upload a video on CssSelectors also...Thanks.

    • @Mukeshotwani
      @Mukeshotwani  Před 8 lety

      +abhishek gupta CSS will updoad next weekend

  • @santosh830
    @santosh830 Před 7 lety

    In hybrid driven framework,why did you use local driver in homepage.your explanation is excellent.thank you

  • @kokilajs7796
    @kokilajs7796 Před 3 lety +1

    Hello sir, I have to write the dynamic xpath so that everytime it should increment and pass that value to xpath and this xpath finding can go upto 2 or 3 pages

  • @Deliquesent
    @Deliquesent Před 4 lety +1

    What is the need of using OR and AND functions in Xpath. If we can find a webelement with 1 unique attribute, then is there a need to specify the other attribute too?

    • @Mukeshotwani
      @Mukeshotwani  Před 4 lety

      Hi Sakshi, in case if one attribute changes so other will be used for identifying web elements.

  • @bibhutijha1113
    @bibhutijha1113 Před 7 lety

    Hi Mukesh ,
    Basically I am QTP tester and i have started learning selenium recently .
    So i would like to know if there is any like register user function which is used in QTP through which we can check the object existence or perform any action without writing the codes again and again we have to write a single function then we have to pass the object to that function and the required action is performed .
    So can we do it in selenium ?
    let me given an example :-
    WebElement UserName = driver.findElement(By.xpath("//*[@id='user_login']"));
    if (UserName.isDisplayed()){
    UserName.sendKeys("admin");
    }
    So i want i dont have to write these 3 above line . i will just pass xpath , value , varaible name.
    please help

  • @manishrajurkar8161
    @manishrajurkar8161 Před 5 lety +1

    HI Mukesh, In Salesforce Lightning mode, with AURA framework, there are no unique attributes identified. we are taking reference of the preceding /following and taking index number element to generate XPath. However, there are still more challenge, the XPath you design will not work next time on UI index get changed. are there any best practice to deal with this situation?

    • @Herrmann2k
      @Herrmann2k Před 5 lety +1

      I am also facing the same issue using Salesforce Lightning, the index gets changed after a few runs. can you please suggest how do we deal in this?

    • @lorenzovidaurre1491
      @lorenzovidaurre1491 Před 5 lety

      Hola a todos!! me sucede lo mismo, si tiene alguna ayuda comenten, por favor

    • @lorenzovidaurre1491
      @lorenzovidaurre1491 Před 5 lety

      con este Xpath //a[@class='select' and @xpath='1'] puedo encontrarlo en ChroPath el elemento buscado, pero cuando lo ingreso en el Xpath muestra error Select drpCountry = new Select (driver.findElement(By.xpath("//*[@class='select' and @xpath='1']")));

  • @RajuDas-zn3gx
    @RajuDas-zn3gx Před 5 lety

    Mukesh, for my application I have written a xapth to identify a label as //td[text()=‘CK_SUM’] and this works good for chrome but does work for ie. can you please help me to fix this?

    • @vishwa2433
      @vishwa2433 Před 5 lety

      Xpath for ie some time change, check the unique identifier for parent /grand parent and find the child td

  • @vishavgupta3717
    @vishavgupta3717 Před 4 lety

    Thank you very much

  • @momomeshtv7318
    @momomeshtv7318 Před 3 lety +2

    can we find the xpath of facebook video / post comments? it appears to be a list or something that needs to click before it expands out.... furthermore it doesn't show ALL the comments you have to click on the view more to get all.... is that doable with selenium?

    • @Mukeshotwani
      @Mukeshotwani  Před 3 lety +1

      Hi Buddy please check this www.selenium.dev/documentation/en/worst_practices/gmail_email_and_facebook_logins/

  • @nihardash9619
    @nihardash9619 Před 4 lety +1

    Hi Mukesh,the website you are using for example not working in google chrome(wordpress),can u use some other geninue websites which are working in google chrome and explain the same things .Thanks for your videos

    • @Mukeshotwani
      @Mukeshotwani  Před 4 lety

      Hi Nihar, you can use this application for testing opensource-demo.orangehrmlive.com/

  • @tarunakalra8993
    @tarunakalra8993 Před 4 lety +2

    Hi Mukesh ..Your sessions are really helpful but it would be good if you write sequence number of sessions for beginners.

    • @Mukeshotwani
      @Mukeshotwani  Před 4 lety

      Thanks Taruna, sure I will make them is sequence soon.

  • @gavishwa
    @gavishwa Před 6 lety +1

    Nice One Mukesh.Thanking you for sharing the info. From FireFox v 57 we do not have support for Fire Bug. Could you please share more info on how to get the x path by using fire fox v 57..

    • @praveen420ify
      @praveen420ify Před 6 lety

      1. Open mozila Developer window.( Press f12)
      2. Spy on required Element.
      3. right click on Path comes in Developer window after spying element
      4. Click COPY option and then U can select xpath( Or other locator options)

  • @keshojukavya2830
    @keshojukavya2830 Před 4 lety +1

    Hi Mukesh, How do we create xpath in chrome? Because there is no firebug in firefox now. Please help

    • @Mukeshotwani
      @Mukeshotwani  Před 4 lety

      Here is the link czcams.com/video/9N7ERYWbjuw/video.html

  • @piyushratnam5490
    @piyushratnam5490 Před 7 lety

    Hi Mukesh,
    Thanks for this Video, you have nicely explained everything, learnt a bit more about writing XPATHs. One thing stroked my mind - Does HTML have a tag as well, got confused with below example, Syntax : //tagname[starts-with(@attribute-name,’’)]
    e.g. //id[starts-with(@id,’’)]

    • @Mukeshotwani
      @Mukeshotwani  Před 7 lety

      Hi Piyush,
      HTML is the parent tag but it does not have any id. Xpath examples will be applicable for other elements.

  • @nitingupta82
    @nitingupta82 Před 8 lety

    Another excellent video Mukesh! But please help me explain the difference when we are using the text() method.
    There are 2 ways it shows for text() ' = ' & ' , ' .
    One form is //a[contains(@href, 'edit.php'')][text() = 'Posts'] and other is //a[contains(text(), 'Dismiss this message')]
    Am not sure which method should we follow = or , after text() method.
    Is there any standard that must be followed or it's more of hit n trial in particular for text() method?

    • @Mukeshotwani
      @Mukeshotwani  Před 8 lety +1

      +Nitin Gupta Hi Nitin let me clear it
      Text()- This will chek for exact text and if found then only it will return result.
      while
      contains(text(),'')- it only check partial text

  • @sudhakark8386
    @sudhakark8386 Před 7 lety

    Hi mukesh I am unable identify the drop down element.
    I.e //div[@class='mclc' and text()='002region']
    how to identify this one..
    could you please help me.

  • @himanshuthakur1605
    @himanshuthakur1605 Před 7 lety

    hi mukesh . An interviewer ask me how to handel if there is suppose in one row display ''himanshu'' as link and next to column again ''himanshu'' as a text and below this row in another row written ''himanshu'' as text and next to another column ''himanshu'' as link. then how will be locate ''himanshu'' in 2nd row first column then click on link ''himanshu'' in 2nd column with out using xpath or other locator? this kind of scenario was there? Pls help me

    • @nmkkannan1256
      @nmkkannan1256 Před 7 lety +1

      Use findElements(By.linkText()). Use index to specify

  • @dbvs007
    @dbvs007 Před 8 lety

    Very useful thanks Mukesh

    • @Mukeshotwani
      @Mukeshotwani  Před 8 lety

      +Bhanu Surendra THanks Bhanu keep visting

  • @shivuvali
    @shivuvali Před 7 lety +1

    hi mukesh..what is the version of the FF you have used in the above tutorial.

  • @90ankush
    @90ankush Před 8 lety

    Hi Mukesh,
    In other video you explained the exception which comes when we use FF 47 and selenium 53. So as per you i degraded FF to 46.0. It worked perfectly fine for a day or two. But again it started throwing org.openqa.selenium.firefox.NotConnectedException.
    Could you please help here .
    Thanks !!
    Ankush

    • @Mukeshotwani
      @Mukeshotwani  Před 8 lety

      Stick to 45 and Selenium 2.53 which will make test stable.

  • @sajeerkunnoth6630
    @sajeerkunnoth6630 Před 5 lety +4

    In this video, 16 second's you are explaining how to use contains, but it's not working because you have used "//input[contains(@name='post_title')] " In my understanding if your using contains you have to use coma. Eg: //input[contains(@name='post_title')]

  • @joyitaroy123
    @joyitaroy123 Před 3 lety +2

    Hi Mukesh...I was working on drop down automation. I took the example of registration page of FB. But it has been changed to a registration pop up box unlike before. I went through your fb drop down(dob)handling video. But now when I click on create new account button from homepage one registration pop up is opening. I am not getting control of the pop up window and unable to select drop down or write text in the text box. Tried everything. Is it possible to automate the pop up form without using javascript? Please help me.

    • @Mukeshotwani
      @Mukeshotwani  Před 3 lety +3

      Hey Joyita Here is the code which is working fine
      WebDriver driver=new ChromeDriver();
      driver.get("facebook.com");
      driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
      driver.findElement(By.xpath("//a[text()='Create New Account']")).click();
      driver.findElement(By.name("firstname")).sendKeys("Mukesh");
      Select bday=new Select(driver.findElement(By.name("birthday_day")));
      bday.selectByValue("10");

    • @Mukeshotwani
      @Mukeshotwani  Před 3 lety +1

      You need to add implicit wait in your script which can prevent script failure. When we click on create button then it take 2-3 second to bring the pop up. Do watch this video for implicit wait czcams.com/video/iR0gfRGjW98/video.html

    • @joyitaroy123
      @joyitaroy123 Před 3 lety +1

      Thanks a lot Mukesh. I haven’t seen your reply. Just today I tried with your code. It’s working now 🙂

    • @Mukeshotwani
      @Mukeshotwani  Před 3 lety

      No problem it happens. I am glad it worked 😌

  • @arijitbhattacharjee5243
    @arijitbhattacharjee5243 Před 7 lety +1

    Hi Mukesh Sir,
    Thank you so much. Its really helpful. But i have one query:
    How to handle auto-suggest search drop down in selenium webdriver?
    Can you please guide.

    • @Mukeshotwani
      @Mukeshotwani  Před 7 lety

      You can use findElements method and list concept in Selenium to handle autosuggestions.

  • @baldygaming2226
    @baldygaming2226 Před 7 lety

    Hi mukesh, im having trouble with xpath, my issue is this. it works perfectly fine with firefox but then it comes to chrome it gives me this kind of error
    org.openqa.selenium.WebDriverException: unknown error: Element ... is not clickable at point (1364, 408). Other element would receive the click: ...
    im just confused why?
    Thank you again mukesh have a blessed day

  • @lakshmisatti2588
    @lakshmisatti2588 Před 5 lety +1

    can u upload all ur selenium clases in sequential mannaer we not able to find ur all videos regarding selenium

  • @vvkkumar3691
    @vvkkumar3691 Před 5 lety +1

    "org.openqa.selenium.ElementNotInteractableException: Element is not reachable by keyboard" . I am getting this error could you help me.

    • @Mukeshotwani
      @Mukeshotwani  Před 5 lety

      HI Kumar please check below link learn-automation.com/invalidelementstateexception-in-selenium-webdriver/

  • @bobin1619
    @bobin1619 Před 7 lety +1

    good explanation..

  • @ravi_nelluri
    @ravi_nelluri Před 8 lety +1

    In my application I have two fields say Email id and Conform Email id . For both of them id,class name everything is same. In this situation who can i find specific test box

    • @Mukeshotwani
      @Mukeshotwani  Před 8 lety

      +Ravi Nelluri in part 2 I have covered this scenario please visit part2

  • @sankassasenevirtha2049
    @sankassasenevirtha2049 Před 4 lety +1

    Really helpfull

  • @lakshmisatti2588
    @lakshmisatti2588 Před 5 lety +1

    if we dont use firebug addin how derive xpath with our wonself

    • @Mukeshotwani
      @Mukeshotwani  Před 5 lety

      Hi Lakshmi we have new plugin for xpath now czcams.com/video/kjTsGnkPQEc/video.html

  • @prasanthsp7694
    @prasanthsp7694 Před 2 lety

    How to take XPath for this text (Today's Deals) by using text XPath.

  • @KevinLi-wx1kq
    @KevinLi-wx1kq Před 8 lety +1

    Any info about how to handle svg object/graph (using css/xpath) in Webdriver?

    • @Mukeshotwani
      @Mukeshotwani  Před 8 lety

      +Kevin Li Hi Kevin,
      Any example of SVG objects?

  • @lalitkumar2855
    @lalitkumar2855 Před 6 lety

    Hi Mukesh, can you please help me get xpath to log into Paytm?

  • @sudheer1330
    @sudheer1330 Před 8 lety

    Hi Mukesh,
    While adding Assert, am getting error "This element neither has attached source nor attached Javadoc and hence no Javadoc could be found.". could you please help.

    • @Mukeshotwani
      @Mukeshotwani  Před 8 lety

      You can attach SRC jar then this error wont come

  • @narasimhareddy1103
    @narasimhareddy1103 Před 6 lety +1

    Nice Video Mukesh. I am facing difficult in identitifying the xpath for an element called "My Account" button in the home page of the url "www.phptravels.net/".
    I have tried using Firebug and absolute Xpath. The problem is in webpage the Web Element is highlighted but during run time the WebDriver is unable to Identity the button. Please Help.

  • @Jayakrishna-ly3ei
    @Jayakrishna-ly3ei Před 3 lety +1

    4:38 hi sir,
    1st we write username, we gave a tab button, now we are in password textbox,we send data now in this . how to write the program for this ?

    • @Mukeshotwani
      @Mukeshotwani  Před 3 lety +1

      You can use sendKeys with Keys option or Actions class.

    • @Jayakrishna-ly3ei
      @Jayakrishna-ly3ei Před 3 lety

      @@Mukeshotwani I tried sir I am not getting. Can u send me that 4 or 5 lines code sir ?

  • @joshnaranimohapatro4132
    @joshnaranimohapatro4132 Před 4 lety +1

    please give me the link ,for learn automation for dynamic x path

    • @Mukeshotwani
      @Mukeshotwani  Před 4 lety

      Hi Anjali, here is the link learn-automation.com/how-to-write-dynamic-xpath-in-selenium/

  • @purusingh2793
    @purusingh2793 Před 6 lety

    i am not getting the html content pls help me..........

  • @parulisha
    @parulisha Před 7 lety +1

    Hi
    Can you help writing the code if there are 100 text fields on one Page and we want to count the number of such fields which are purgent?
    Thanks

    • @Mukeshotwani
      @Mukeshotwani  Před 7 lety +1

      Hi Parul nice question you can use findElements and then size method to get the count learn-automation.com/difference-between-findelement-and-findelements-in-selenium-webdriver/

    • @parulisha
      @parulisha Před 7 lety

      Thanks Mukesh.

    • @Mukeshotwani
      @Mukeshotwani  Před 7 lety

      Cheers

  • @mastanmmr374
    @mastanmmr374 Před 7 lety +1

    hi mukesh'
    when to use absolulative & relative xpath

    • @Mukeshotwani
      @Mukeshotwani  Před 7 lety

      It is up to your requirement I use combination of both.

  • @dbvs007
    @dbvs007 Před 8 lety

    Syntax seems incorrect when we want to use multiple attributes(video @11:14 min) , @ symbol is missing for the 2nd attribute.... Thanks

  • @tomg2982
    @tomg2982 Před 7 lety +1

    Hi Mukesh, This is really good tutorial, thank you.
    Could you please explain how to find xpath for elements which are repeated several times in several the same tagnames ex:
    for odds in bet365 : the following sentence :
    10/1 is repeated over 10 times.
    How to write xpath for the one interresting me?
    Regards: Tom

    • @ravikumar-sharma-k
      @ravikumar-sharma-k Před 7 lety

      Tomasz G use xpath like this:WebElement element = //*[@class=gl-Participant_Odds].It will find all elements with that class.

    • @ravikumar-sharma-k
      @ravikumar-sharma-k Před 7 lety

      Tomasz G use xpath like this:WebElement element = //*[@class=gl-Participant_Odds].It will find all elements with that class.

  • @mushfiquazaman9597
    @mushfiquazaman9597 Před 8 lety

    Helo Mukesh,your videos are so wonderful, But I cannot access learn-automation.com site. isn't it open for everybody. Please help. Thanks.

    • @Mukeshotwani
      @Mukeshotwani  Před 7 lety

      Thanks Zaman, There was some maintenance so blog was down,

  • @arundhathimurthy3176
    @arundhathimurthy3176 Před 7 lety

    contains function(16:03) didn't work because of wrong syntax. //input[contains(@name,'post_title')] should work.

  • @subhasisrupali
    @subhasisrupali Před 7 lety +1

    Hey Mukesh - Any idea if firebug has been merged with firefox developer tool? I have FF 51 on my laptop and firebug 2.0.18 is deactivated. There is no way for me to check the xpath. Can someone please help on this.

    • @Mukeshotwani
      @Mukeshotwani  Před 7 lety +1

      Hi Subhasis, Kindly use FF 48 or 50 then install firebug from add on it is working for me.

    • @chetu19
      @chetu19 Před 7 lety +1

      ftp.mozilla.org/pub/firefox/releases/ Firefox release versions.

    • @prashanttiwari5855
      @prashanttiwari5855 Před 7 lety +1

      Hi Subhasis, you have install the older version 50.1.0 for FF. the latest version is not supporting firebug.

    • @pushpaksharma9906
      @pushpaksharma9906 Před 7 lety +1

      Hi Subhasis,
      Please perform the below steps
      1. Open a new tab in the browser
      2. type about:config
      3. Now search for browser.tabs.remote.autostart
      4. Toggle the value to False
      Hope this will work

    • @Mukeshotwani
      @Mukeshotwani  Před 7 lety

      Use FF 46

  • @dilshodalikiulov2150
    @dilshodalikiulov2150 Před 7 lety +1

    Thanks

  • @Bujji28243
    @Bujji28243 Před 7 lety +1

    we have two fields username and password ,but our attribute both r same example id=ABC, both username and password attribute s r same then how we can pass text only one field username???how to write xpath???

    • @Mukeshotwani
      @Mukeshotwani  Před 7 lety

      Hi Nagu,
      You can use findElements and get the index and play with web elements.

    • @Bujji28243
      @Bujji28243 Před 7 lety

      Thanks for giving a reply but little bit confusion, how to perform index number can you write sample code for me, please......

  • @TheArian291
    @TheArian291 Před 6 lety

    Hi Sir, supposing I've the values 1234 is changing every time so will the below xpath work out?
    //*input[contains(@id,'abc')] or i need to give some other changes.. pls help

    • @iliyas868
      @iliyas868 Před 6 lety +1

      this should work considering no other element consists of an ID having the string 'abc' in it. Correct me if i'm wrong!

    • @vishwa2433
      @vishwa2433 Před 5 lety

      Use starts-with instead of contain, as your element id begins with abc.... Also if you find any where else on page these sort of ids are shown start custome xpath at unique parent or frand parent and then find id starts-with abc

  • @nmkkannan1256
    @nmkkannan1256 Před 7 lety

    How to locate Xpath by text if the text is 'I'm Feeling Lucky'

    • @Mukeshotwani
      @Mukeshotwani  Před 7 lety

      +Inty Uyghur haha very nice 👍🏻 Inty

  •  Před 6 lety

    how i get this addon to firefox ??
    please help me

    • @arsaurabh6044
      @arsaurabh6044 Před 6 lety

      www.techbeamers.com/use-firebug-and-firepath-in-firefox/

  • @tapaskhandai
    @tapaskhandai Před 4 lety +1

    Which browser u r using?

    • @Mukeshotwani
      @Mukeshotwani  Před 4 lety +1

      it is Firefox earlier we have firebug and firepath where we used to write xpath.

    • @Mukeshotwani
      @Mukeshotwani  Před 4 lety +1

      Hi Tapas here is the link for updated video czcams.com/video/kjTsGnkPQEc/video.html

    • @tapaskhandai
      @tapaskhandai Před 4 lety

      @@Mukeshotwani Thank you

  • @julyuser1030
    @julyuser1030 Před 4 lety +1

    Good

  • @hakan2048
    @hakan2048 Před 5 lety +1

    How do I capture dynamic id.

    • @Mukeshotwani
      @Mukeshotwani  Před 5 lety

      Hi Tektas any example so that I can show you the solution..

    • @hakan2048
      @hakan2048 Před 5 lety

      I can't share the code, but there is a situation. The input screen also changes the ID page every time you refresh.

    • @kalyantpv
      @kalyantpv Před 5 lety +2

      I had a similar situation where the id was changing based on the data that shows up on screen. However, it was based on a particular logic.. so the id was being suffixed by an id in database etc.. so I wrote code to first figure out what that value would be depending on input data and then dynamically figure out the id. Maybe your situation is even more dynamic?

  • @neelamchakraborty9062
    @neelamchakraborty9062 Před 6 lety +1

    How to get xpath of watermark .

    • @Mukeshotwani
      @Mukeshotwani  Před 6 lety

      Any example or demo site for this ?

    • @neelamchakraborty9062
      @neelamchakraborty9062 Před 6 lety

      Don't know was asked in interview. How to get an xpath of a watermark. if you find something please share. I guess this is a transparent object such as company logo.