Pages

Search This Blog

Wednesday, October 6, 2010

How to verify value in drop down list.

How to verify value in drop down list.
We somehow manage to find the element on the page but its difficult to fund element with some specific attributes.
Take an example How to find some value is in drop down list or now? To find element drop down is easy but to find a drop down having some specific
value in their list is difficult.

Go to www.ebay.in you will see there is drop down along with search text box.
How to veify a specific value "Collectibles" is in drop down list.

Using Xpath:

<tr>
 <td>verifyElementPresent</td>
 <td>//select[@id='_sacat']/option[contains(text(),'Collectibles')]</td>
 <td></td>
</tr>

verifyTrue(selenium.isElementPresent("//select[@id='_sacat']/option[contains(text(),'Collectibles')]"));


Using CSS:

<tr>
 <td>verifyElementPresent</td>
 <td>css=select#_sacat>option:contains("Fun")</td>
 <td></td>
</tr>

verifyTrue(selenium.isElementPresent("css=select#_sacat>option:contains(\"Fun\")"));

<tr>
 <td>verifyElementPresent</td>
 <td>css=select>option:contains("Fun")</td>
 <td></td>
</tr>


How to select the value in drop down using regular expression.

There are situation when we need to select the drop down value with some partial text .
With the help of regular expression we can select the drop down value

<tr>
 <td>select</td>
 <td>_sacat</td>
 <td>label=regexp:Fun*</td>
</tr>

selenium.select("_sacat", "label=regexp:Fun*");


84 comments:

  1. Hi Niraj,
    Very Very usefull Blog. Frankly speaking i am learning selenium thru your website.
    I have one dount.
    in ebay.in if u need to find the xpath of categories i.e. for ex: Watches under categories. How to find?

    Thanks,
    Sudbhir Bhat

    ReplyDelete
  2. Sorry for late reply.
    In fact we have to find category drop down element. And all the list in drop down will be known by its label.
    so first using xpath we will find th drop down to locate this.
    xpath=//select[@id='_sacat']
    then with the help of label will find out the watches category.
    label=Watches

    <tr>
    <td>select</td>
    <td>xpath=//select[@id='_sacat']</td>
    <td>label=Watches</td>
    </tr>
    or
    selenium.select("xpath=//select[@id='_sacat']", "label=Watches");

    let me know if dint find any luck on that

    ReplyDelete
  3. Spot on with this write-up, I really believe this amazing site needs far
    more attention. I'll probably be back again to see more, thanks for the information!
    Also see my web page: view this site

    ReplyDelete
  4. I like it when folks get together and share thoughts.
    Great website, keep it up!
    Here is my webpage ... how can I get taller

    ReplyDelete
  5. Greetings! I know this is kinda off topic but I was
    wondering which blog platform are you using for this website?
    I'm getting sick and tired of Wordpress because I've had issues with hackers and I'm looking at alternatives for another platform. I would be awesome if you could point me in the direction of a good platform.

    Also visit my blog post :: internet dating websites

    ReplyDelete
  6. Hey! This is my first visit to your blog! We
    are a team of volunteers and starting a new project in a community in the same
    niche. Your blog provided us beneficial information to
    work on. You have done a marvellous job!

    my homepage: free dating and chat

    ReplyDelete
  7. Hello There. I found your weblog the usage of msn.

    This is a very neatly written article. I�ll make sure to bookmark it and return to learn more
    of your helpful information. Thank you for the post.

    I�ll definitely comeback.

    my homepage - online datine

    ReplyDelete
  8. Thanks for the points you have shared here.
    Another thing I would like to talk about is that computer memory requirements
    generally increase along with other breakthroughs in the technological know-how.
    For instance, when new generations of cpus are introduced to the market, there is usually a matching increase in the shape eferences of
    both the pc memory and hard drive space. This is because the
    software program operated by way of these processors will inevitably rise in power to make new engineering.


    Here is my website: fuckbook

    ReplyDelete
  9. I just could not leave your website prior to suggesting that I really loved the usual info an individual supply
    on your visitors? Is gonna be back ceaselessly in order to inspect new posts

    Feel free to surf to my website; free adult personals

    ReplyDelete
  10. Hi,

    How to write a xpath ,that ignores the case for example below is the xpath in selenium webdriver


    //div[@id='model-showroom-current-year-container'][div[div[div[div]]]]/div/div/descendant::div[@class='model-name' and contains(text(),' C-MAX')]

    ReplyDelete
    Replies
    1. The xpath should ignore the case of 'C-MAX',Kindly let me know on this Niraj

      Delete
  11. It is perfect time to make a few plans for the future and it is time to be happy.
    I've learn this put up and if I could I desire to counsel you some attention-grabbing things or suggestions. Maybe you could write next articles relating to this article. I desire to read more things approximately it!

    my blog - party hardcore

    ReplyDelete
  12. Greate pieces. Keep posting such kind of information on your page.
    Im really impressed by your site.
    Hey there, You've performed an incredible job. I'll certainly digg it
    and individually recommend to my friends. I'm sure they'll be benefited
    from this web site.

    Here is my page :: http://sexvideovoyeur.com/

    ReplyDelete
  13. First off I would like to say great blog! I had a quick question which I'd like to ask if you do not mind. I was interested to find out how you center yourself and clear your mind before writing. I have had trouble clearing my thoughts in getting my thoughts out there. I truly do enjoy writing but it just seems like the first 10 to 15 minutes are usually lost just trying to figure out how to begin. Any ideas or hints? Many thanks!

    Stop by my web page; xvideo

    ReplyDelete
  14. This comment has been removed by the author.

    ReplyDelete
  15. This comment has been removed by the author.

    ReplyDelete
  16. Its Brilliant knowledge For Over-automation.Over-automation is so good.

    ReplyDelete
  17. Your information about automation is really interesting. Also I want to know the latest new techniques which are implemented in automation. Please update it in your website.

    ReplyDelete
  18. Thanks for sharing great information in your blog. Got to learn new things from your Blog . It was very nice blog to learn about Selenium.
    Selenium

    ReplyDelete
  19. Thanks for sharing great information in your blog. Got to learn new things from your Blog .
    java training in chennai

    ReplyDelete
  20. This is extremely great information for these blog!! And Very good work. It is very interesting to learn from to easy understood.


    software testing course online

    ReplyDelete
  21. hi can any one plz help me to find this dynamic xpath

    html/body/div[5]/div[2]/div[3]/div[2]/div/div[2]/div/div[4]/div/div[1]/div/div/div[2]/div[1]/div/div/fieldset/div/div[1]/div/div[1]/div/div/a

    ReplyDelete
  22. Thanks For Clearing All My Doubts Through Your Website Post.You Cleared All My Doubts.Coming To Our Self We Provide Food Service Parts Through Out US At Very Affordable Prices And Also We Offer Same Day Shipping In US.We Offer Only Genuine Products. Really Thanks For Sharing.

    ReplyDelete
  23. This Blog is very helpful and useful,came to know that i should be strong in my basics and this blog helps me to improve it,Primary Care Chicago Services Provided by Us.Thanks For Posting.I Am refereed by my friend to this blog and i also want to refer my other friends to this blog.

    ReplyDelete
  24. Thank you Admin!
    Real time project center provides IEEE projects in chennai

    ReplyDelete
  25. I like your writing style, it was very clear to understanding the concept well; I hope you ll keep your blog as updated.
    Regards,

    B.com Application Projects in Chennai | Best Project Centers in Chennai.

    ReplyDelete
  26. I Just Love to read Your Articles Because they are very easy to understand USMLE Thank you.

    ReplyDelete
  27. This article is very much helpful and i hope this will be an useful information for the needed one. Keep on updating these kinds of informative things.

    IEEE NS3 Projects in Chennai | IEEE Electronics Projects in Chennai.

    ReplyDelete
  28. Hmm, it seems like your site ate my first comment (it was extremely long) so I guess I’ll just sum it up what I had written and say, I’m thoroughly enjoying your blog. I as well as an aspiring blog writer
    fire and safety course in chennai

    ReplyDelete
  29. Thanks you for sharing this unique useful information content with us. Really awesome work. keep on blogging
    apple service center | apple iphone service center | apple ipad service center | apple mac service center

    ReplyDelete
  30. Please let me know if you’re looking for an author for your site. You have some great posts, and I think I would be a good asset.
    safety course in chennai

    ReplyDelete
  31. Thanks a lot for sharing us about this update. Hope you will not get tired on making posts as informative as this. 

    ReactJS Online Training

    ReplyDelete
  32. Pest control services Chennai is a dedicated service solution to all your pest and insect troubles in Chennai.
    Pest control services in chennai.
    Pest control in chennai.
    Pest control services near me.

    ReplyDelete
  33. Realme Mobile Service center in Chennai
    Realme Servicing by No. 1 Leaders Awesome Services On-time, Every time!
    Realme Mobile Service Center in Chennai

    ReplyDelete
  34. iPhone Service center in Bangalore No. 1 Leaders Awesome Services On-time, Every time!
    iPhone Service Center in Bangalore
    Apple Service center in Bangalore
    Apple Service Center in Bangalore

    ReplyDelete
  35. Mi Service Center in Chennai

    Mi Service Center in Chennai No. 1 Leaders Awesome Services On-time, Every time!
    Mi Service Center in Chennai
    Redmi Service Center in Chennai
    Mi Service Center in Chennai

    ReplyDelete
  36. This comment has been removed by the author.

    ReplyDelete
  37. OnePlus Service Center in Chennai

    OnePlus Service Center in Chennai No. 1 Smart Service On Time, Every Time
    OnePlus Service Center in Chennai
    OnePlus Service Center in Chennai
    OnePlus Service Center in Chennai

    ReplyDelete
  38. Moto service center in Chennai
    Leading Motorola Service Center In Chennai. Fast & Reliable Services On-time, Every time!
    Moto service center in Chennai
    Motorola Service Center In Chennai
    Motorola Service Center In Chennai

    ReplyDelete
  39. Iphone service center in Chennai

    Iphone service Center in Chennai offers you best quality of Services On-time, Every time!
    IPhone Service Center in Chennai
    Apple Iphone Service center in Chennai
    Apple Service Center in Chennai
    Apple Service center in Chennai
    IPhone Service Center in Chennai

    ReplyDelete
  40. Sony Mobile Service Center In Chennai
    Sony Servicing by No. 1 Leaders Awesome Services On-time, Every time!
    Sony Mobile Service Center In Chennai

    ReplyDelete
  41. Nokia Mobile Service Center In Chennai
    Nokia Mobile Service Center In Chennai. Providing Fast, Honest, Reliable & Cost Effective Service Solutions to The Nokia Mobile Users.
    NOkia Mobile Service Center In Chennai

    ReplyDelete
  42. OPPO Service Center In Chennai
    OPPO Service Center Chennai is an end-to-end OPPO service and repair solutions Center.
    OPPO Service Center In Chennai

    ReplyDelete
  43. Ipad service center in Chennai

    Ipad service Center in Chennai offers you best quality of Services On-time, Every time!
    Ipad Service Center in Chennai

    ReplyDelete
  44. Apple Imacbook Service Center in Chennai

    Apple Laptop Service Center in Chennai offers you best quality of Services On-time, Every time!
    Apple Laptop Service Center in Chennai

    ReplyDelete
  45. Acer Service Center in Chennai

    Acer Service Center in Chennai Best service for all model acer laptop and desktop Services On-time, Every time!
    Acer Laptop Service Center in Chennai
    Acer Service Center in Chennai
    Acer Service Center in Chennai

    ReplyDelete
  46. Lenovo Service Center in Chennai

    Lenovo Service Center Chennai
    Lenovo Service Center Chennai
    Lenovo service center near me in Chennai
    Lenovo service center near me in Chennai

    ReplyDelete
  47. Awesome Post!!!

    Redmi Service Center in Chennai

    Redmi Service Center in Chennai No. 1 Leaders Awesome Services On-time, Every time!
    Redmi Service center in chennai
    Mi Service Center in Chennai
    Mi Service Center in Chennai

    ReplyDelete
  48. WOW Great Post!!!

    Apple iPhone Service Center in Chennai

    Chennai No-1 Apple iPhone Service Center in Chennai
    Apple iPhone Service Center in Chennai
    Iphone Service Center in Chennai
    Iphone Service Center in Chennai
    Apple Service Center In Chennai
    Apple Service Center In Chennai

    ReplyDelete
  49. Amazing Post!!!

    Moto Service Center in Chennai

    Best Motorola Mobile Service Center In Chennai. We Offer Fast Repair & Part Replacement Solutions For All Moto Mobile Models.
    Moto Service Center in Chennai

    ReplyDelete
  50. Oneplus Service Center in Bangalore

    Oneplus Repair Service Center in Bangalore. For the finest service and fastest delivery for your Oneplus mobile, visit us! Go home a happy customer! Connect with us!!

    Oneplus Mobile Service Center in Bangalore

    ReplyDelete
  51. Oppo Service Center in Bangalore

    OPPO Service Center in Bangalore is the best OPPO Service Center in Bangalore. We can fix all OPPO devices at low cost with best quality.
    Oppo Repair Center in Bangalore- All our OPPO care technicians has 10+ years experience in the mobile care fix industry

    Oppo repair center in bangalore

    ReplyDelete
  52. I am really very happy to find this particular site. I just wanted to say thank you for this huge read!! I absolutely enjoying every petite bit of it and I have you bookmarked to test out new substance you post.
    I must appreciate you for providing such a valuable content for us. This is one amazing piece of article. Helped a lot in increasing my knowledge.
    AWS training in chennai | AWS training in annanagar | AWS training in omr | AWS training in porur | AWS training in tambaram | AWS training in velachery

    ReplyDelete
  53. This is extremely helpful info!! Very good work. It is very interesting to learn and easy to understood. Thank you for giving information. Please let us know and more information get post to link. Software Testing Training in Chennai | Software Testing Training in Anna Nagar | Software Testing Training in OMR | Software Testing Training in Porur | Software Testing Training in Tambaram | Software Testing Training in Velachery

    ReplyDelete
  54. it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.
    Salesforce Training in Chennai

    Salesforce Online Training in Chennai

    Salesforce Training in Bangalore

    Salesforce Training in Hyderabad

    Salesforce training in ameerpet

    Salesforce Training in Pune

    Salesforce Online Training

    Salesforce Training


    ReplyDelete
  55. Your information about automation is really interesting. Also I want to know the latest new techniques which are implemented in automation. Please update it in your website.
    java training in chennai

    java training in omr

    aws training in chennai

    aws training in omr

    python training in chennai

    python training in omr

    selenium training in chennai

    selenium training in omr

    ReplyDelete
  56. Excellent blog. Lots of useful information here, thanks for your effort!
    Real Estate plots in Vizag

    ReplyDelete
  57. Very Informative blog thank you for sharing. Keep sharing.

    Best software training institute in Chennai. Make your career development the best by learning software courses.

    blue prism training in chennai
    rpa training in chennai
    best msbi training institute in chennai

    ReplyDelete
  58. I believe there are many more pleasurable opportunities ahead for
    individuals that looked at your site.
    oracle dba training in chennai
    java training in chennai
    node js training in chennai

    ReplyDelete
  59. Thank you so much for doing the impressive job here, everyone will surely like your post.
    cyber security course in malaysia

    ReplyDelete
  60. is nice post and I found some interesting information on this blog, keep it up. Thanks for sharing. . .
    One Plus Service Center Near me

    ReplyDelete