Pages

Search This Blog

Sunday, July 6, 2014

Which is the best way to locate an element?

We choose the method based on which gives the element in fastest way in all the browsers. Finding elements by ID is usually going to be the fastest option, because at its root, it eventually calls down to document.getElementById(), which is optimized by many browsers.
Finding elements by XPath is useful for finding elements using very complex selectors, and is the most flexible selection strategy, but it has the potential to be very slow, particularly in IE. In IE 6, 7, or 8, finding by XPath can be an order of magnitude slower than doing the same in Firefox. IE provides no native XPath-over-HTML solution, so the project must use a JavaScript XPath implementation, and the JavaScript engine in legacy versions of IE really is that much slower.
If you have a need to find an element using a complex selector, I usually recommend using CSS Selectors, if possible. It's not quite as flexible as XPath, but will cover many of the same cases, without exhibiting the extreme performance penalty on IE that XPath can.

48 comments:

  1. Software testing is the process of validating a software performance and quality by employing various test cases. Software development industries are striving hard to deliver quality products to their customers. It increases the demand of experienced testing professionals. FITA is reputed software testing training institute in Chennai offering quality education in shaping software testing professionals.

    ReplyDelete
  2. This comment has been removed by a blog administrator.

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

    ReplyDelete
  4. Document.getElementsByClassName() is also one of the best way to locate an element.

    Test Automation

    ReplyDelete
  5. Hi, I wish to be a regular contributor of your blog. I have read your blog. Your information is really useful for beginner. I did QTP Course in Chennai at Fita training and placement academy which offer best Selenium Course in Chennai with years of experienced professionals. This is really useful for me to make a bright career.

    ReplyDelete
  6. Really awesome blog. Thanks for sharing this informative blog. Currently I have completed Software Testing Training in Chennai at a reputed training institutes. If you are looking for best Software Testing Training Institutes in Chennai reach FITA located at Chennai, India.

    ReplyDelete
  7. This comment has been removed by a blog administrator.

    ReplyDelete
  8. Thanks for sharing informative article on mobile testing. It helped me to understand the future of mobile application development and need of mobile application testing training. Think of joining mobile application testing training in Chennai from reputed IT placement or training academy.

    ReplyDelete
  9. That was a very informative post. Thank you so much. Keep posting more.
    Raksha
    QTP Training in Chennai | QTP Training in Chennai

    ReplyDelete
  10. Thanks for sharing this information. I read your blog and found it very useful. I used it in my training as it is easy to understand for beginners. It is important to make sure that the software application working precisely for the reason it originally designed for.
    software training institutes in Chennai | mobile testing training | software training institutes in Chennai

    ReplyDelete
  11. This comment has been removed by a blog administrator.

    ReplyDelete
  12. Thanks for your post; selenium is most trusted automation tool to validate web application and browser. This tool provides precise and complete information about a software application or environment. Selenium Training in Chennai | Selenium Course in Chennai | Best Selenium training institute in Chennai

    ReplyDelete
  13. Nice content. Software testing is the process of finding software bugs by executing program.
    software testing training in chennai | software testing course in chennai| FITA Velachery |

    ReplyDelete
  14. Selenium is a testing tool which is an open source which can work very well for the professionals and for testers. If a profesional is knowing manual testing then if he learn seenium then there are good chance for career growth.
    selenium training in chennai | selenium training institute in chennai | selenium course in chennai

    ReplyDelete
  15. Very nice blog...
    Great information provided. I appreciate your work.software testing training in noida

    ReplyDelete
  16. 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
  17. Excellent post!!!. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.
    salesforce training in chennai | salesforce training institute in chennai

    ReplyDelete

  18. Thank you for the info. It sounds pretty user friendly. I guess I’ll pick one up for fun. thank u.

    Test Automation Tools Training in Chennai

    ReplyDelete
  19. looking for the best WebSphere Training in chennai? Then join at Greens Technology's WebSphere Training in Chennai

    ReplyDelete
  20. It was very nice blog to learn about Selenium.Thanks for sharing new things.selenium training in chennai

    ReplyDelete
  21. Advanced Selenium Framework Training in Chennai by Vishwa

    Hi, Reach Mr.Vishwa for Best Selenium and Coded UI Training in Chennai with real time project assistance. This people will teach everything from the basics up to advanced level scenarios from frameworks.

    I learned from Mr.Vishwa and Raj they are very good automation people for Selenium Frameworks. After joined with them I learned many things and now I am writing automation scripts in own project. Vishwa 9003085882
    selenium training in chennai

    ReplyDelete
  22. nice blog good information and thanks for sharing...

    ReplyDelete
  23. As disussed above software testing is one of the important field in detecting the bugs. In Software testing selenium training institute in Chennai we are enabled to identify the errors with selenium course and can match the actual results with that of expected results.

    ReplyDelete
  24. It was very nice blog to learn about Selenium.Thanks for sharing new things.selenium training in chennai

    ReplyDelete
  25. We Reduced the batch size to make our training more interactive, well structured & timing too made more flexible for students convenient.
    Android Training in Velachery |
    Android Training in Anna Nagar |
    Android Training in Velachery |
    Android Training in Chennai |

    ReplyDelete
  26. Nice tips for someone new into the world of java Really great tips and finally definitely will help to develop a program in java.
    java training in chennai

    ReplyDelete
  27. Nice tips for someone new into the world of java. Really great tips and finally definitely will help to develop a program in java.
    java training in chennai

    ReplyDelete
  28. hi welcome to this blog. really you have post an informative blog. it will be really helpful to many peoples. thank you for sharing this blog.
    java training in chennai

    ReplyDelete
  29. hi welcome to this blog. really you have post an informative blog. it will be really helpful to many peoples. thank you for sharing this blog.
    java training in chennai

    ReplyDelete
  30. hi welcome to this blog. really you have post an informative blog. it will be really helpful to many peoples. thank you for sharing this blog.
    java training in chennai

    ReplyDelete
  31. Nice tips for someone new into the world of java. Really great tips and finally definitely will help to develop a program in java.
    java training in chennai

    ReplyDelete
  32. hi welcome to this blog. really you have post an informative blog. it will be really helpful to many peoples. thank you for sharing this blog.
    java training in chennai

    ReplyDelete
  33. Thanks for the awesome share
    We at Colan Infotech Private Limited best web design company in chennai,is Situated in US and India,
    will provide you best service in qa testing services
    Design Services and Colan Infotech has a group of exceedingly dedicated, inventive and creative experts with an energy for delivering exciting ,
    helpful and stylish Web and Mobile Applications, We are one of the best software testing services company
    and of course we stepped in bangalore too we are best qa and testing services
    can provide quality assurance and testing services,
    we are the best among the software testing company india

    ReplyDelete
  34. SELENIUM
    From My search…Creating Experts provides Best Selenium Training with real time projects assistance.Most of the modules are equipped with advance level topics which the student can learn from the basics to the advance level stage.They also provide placement assistance in leading MNC companies across the globe according to the current requirements.
    And these are the Best selenium training institute which provides Real Time Hands on Training…
    Codedion Technologies-9003085882
    Creating Experts-8122241286
    They also providing both Classroom/Online Training

    ReplyDelete