Sunday, September 5, 2010

Locator for cell containing nbsp in Selenium RC

If you want to point to a table cell containing a   (non breaking space) character then you must use the unicode equivalent of nbsp i.e \u00a0 in your locator. Interestingly this is required only in Selenium RC. A simple space would suffice if you were to achieve this in Selenium IDE. Below is the sample HTML code that has the table with the cell containing the nbsp and the selenium RC instruction to highlight that cell.

<table border="1">
<tr>
<td>abcd&nbsp;efgh</td>
<td>abcdefgh</td>
</tr></table>



selenium.highlight("//td[text()='abcd\u00a0efgh']");

22 comments:

  1. Hi Mahesh,

    I am using selenium RC with Visual Studio 2010 IDE and created tests.
    Here i am facing a problem in identifying dynamic objects.
    Object id looks like "ctl00_MainEntry_AreaCreationControl_AreaGridView_ctl12_AreaNameFooterTextBox"
    Here ctl12 is the part which is changing based on which row...But i want to enter the value irrespective of row position..

    I tried many things but no luck.. Here are the details...

    //*[@id='ctl00_MainEntry_AreaCreationControl_AreaGridView_ctl12_AreaNameFooterTextBox'] works fine in Selenium IDE when I click FIND button in IDE.
    But below are not working in selenium IDE when I click FIND.
    (1)
    //input[Contains(@id,'ctl00_MainEntry_AreaCreationControl_AreaGridView_ctl') and Contains(@id,'_AreaNameFooterTextBox')]
    (2)
    //input[@id,RegExp:'ctl00_MainEntry_AreaCreationControl_AreaGridView_ctl??_AreaNameFooterTextBox']
    (3)
    //input[@id,glob:'ctl00_MainEntry_AreaCreationControl_AreaGridView_ctl*_AreaNameFooterTextBox']
    (4)
    //*[@id,glob:'ctl00_MainEntry_AreaCreationControl_AreaGridView_ctl*_AreaNameFooterTextBox']


    Can u help me on this... How can I identify this object? Can u give me your mail id to contact u on this problem and further for selenium automation....

    Thx in advance....
    SCSVEL
    scsvel@gmail.com

    ReplyDelete
  2. thanks for the run though of you pocess, it was much needed. another point of view for this cheers www.globalkap.com

    ReplyDelete
  3. Hello,

    i am representing www.mrosupply.com - industrial goods ecommerce store, extension of a family owned 114 year old business selling motors, electrical components, conveyor belting and related products. In this, we are looking for opportunities to buy inexpensive links from various blogs, websites, etc.. We would like to get a small tiny link on your website, on the homepage preferably. How much would that cost?

    Thank you in advance.
    Regards,
    Yanina Dani
    email: kievforyou@gmail.com

    Baldor Single Phase motors

    ReplyDelete
  4. Automated testing is critical to cost-effectively developing and deploying quality software applications on time. What is Application Packaging

    ReplyDelete
  5. Wowwiee..... what a blog written.... :) gives detailed view of test automation. Nice sharing. Cheers :) building automation

    ReplyDelete

  6. Thanks for such awesome blog. Your article is very easy to understand, informative and provide complete overview about software testing. Please consider including rss feed in your website, so I get your recent post on my site. Best software testing training in Chennai.

    ReplyDelete
  7. Well explained & Really informative post, Quality assurance & Testing ensure a high level of quality in production during the development of products or services.
    For Functional testing Service, Performance testing service, Automation testing visit the above link.

    ReplyDelete
  8. Best quality training for Automation Anywhere in Chennai. All our trainers are well-experienced experts. Please visit our website for more info: Best Automation Anywhere Training Institute in Chennai

    ReplyDelete
  9. Very Informative and creative contents. This concept is a good way to enhance the knowledge. thanks for sharing.
    Continue to share your knowledge through articles like these, and keep posting more blogs.
    And more Information The Top 5 Test Automation Frameworks in 2022

    ReplyDelete
  10. Test Plan is a dependable and effective test plan tool that assists teams in planning, tracking, and managing testing operations. Test Plan, with its simple user interface and extensive functionality, helps teams to optimise their testing process and assure product quality.

    ReplyDelete
  11. Smart home automation with the best technology and products. Make your home smarter and easier to control with automated lighting, thermostats, security systems, and more. Get connected with the right products from leading brands for a smarter home.

    https://myelegante.in/home-automation-services/

    ReplyDelete
  12. بالتوفيق اعمال مميزة شارك اعمالنا تُعد الخيار الأمثل لكل من يسعى لتحسين جودة حياته المنزلية من خلال خدمات تنظيف شاملة تسليك مجاري محترف، ومكافحة فعالة للحشرات شارك اعمال شركة تسليك مجاري بسيهات التزامها بالجودة والاحترافية يجعلها تبرز بين الشركات الأخرى ويضعها في مقدمة قائمة الخيارات لكل من يرغب في تحويل منزله إلى بيئة مثالية .

    ReplyDelete