SPONSORS:






User Tag List

Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3
  1. #1
    Apprentice
    Join Date
    Dec 2013
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Question Need help figuring out XPATH

    Seniors, I am trying to teach myself Selenium with Java. I am not able to create Xpath and Firebug is giving me this from code : <span class="label-text">One-way</span>.

    I am trying to click Oneway on website. How would you create Xpath with the code above? I am not from Java background so please forgive if this is basic in Java world.

  2. #2
    Member
    Join Date
    Feb 2009
    Posts
    62
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0
    Try using the generic convention for forming an XPath : //<objectType>[@property=’propertyvalue’].

    i.e. In this case : //span[@class=’label-text’].

    This should work in case these are the unique property value combination for this object.

  3. #3
    Apprentice vishaldutt.testing's Avatar
    Join Date
    Jun 2016
    Posts
    12
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0
    Quote Originally Posted by tanejanidhi6 View Post
    Seniors, I am trying to teach myself Selenium with Java. I am not able to create Xpath and Firebug is giving me this from code : <span class="label-text">One-way</span>.

    I am trying to click Oneway on website. How would you create Xpath with the code above? I am not from Java background so please forgive if this is basic in Java world.
    Hi,

    I am working in a software qa company that provides functional testing services and below are few Xpath's that you can try:-

    1. //span[text()='One-way']
    2. //span[contains(text(), 'One-way']
    3. //span[@class='label-text']

    Note:- The span text and span class should be unique on that page.

    Thanks,
    Vishal

  4. Thanks sumitkumarwatts thanked for this post
 

 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.34%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 07:46 PM.

Copyright BetaSoft Inc.