123ArticleOnline Logo
Welcome to 123ArticleOnline.com!
ALL >> Computer-Programming >> View Article

What Is Selenium Webdriver Object Repository And How To Utilize?

Profile Picture
By Author: Siyaram eay
Total Articles: 79
Comment this article
Facebook ShareTwitter ShareGoogle+ ShareTwitter Share

Selenium Webdriver offers no protest vault execution as a matter of course. Be that as it may, actualizing and utilizing a fundamental question store is truly clear. In this article, will demonstrate to you best practices to do it and how to help the weight of test script support along these lines.

Not at all like QTP/UFT, Selenium does not offer the default execution for protest store. In QTP things are truly clear, simply protest see the controls and add to question vault, and further with the endowments of intelligence highlight in its IDE, use them effortlessly in composing scripts.

However, how we can accomplish the same in selenium?

It should be possible by utilizing Properties document highlight of Java.
What is Object Repository?

Question Repository is an incorporated area where we can store objects data, it goes about as interface between Test script and application with a specific end goal to distinguish the items amid the execution.

We generally suggest utilizing outer document for question archive as opposed to hard coding the articles and its properties straightforwardly ...
... into our code. Why this??? As it diminishes the support exertion and gives positive ROI, for instance say any of the question properties change inside our application under test, we can undoubtedly transform it in outer protest storehouse record, as opposed to scanning and doing refreshes for that question exclusively in the code.

Protest Repository Samples: -

Part - System Admin

• ManageUsers.Properties
• ManageDepartments.Properties
• ManageLocations.Properties

Why and How to utilize Object Repository?

To play out any activity we require locators. Instrument will play out any activity in view of the locators. For every single activity instrument relies on upon these locators. On the off chance that the apparatus does not recognize the locators, it basically tosses a blunder as Locator/Element Not Found or Identified.

With a specific end goal to ensure the apparatus executes easily, we have to give precise one of a kind identifier/locators.

We have to keep every one of the locators at one place where we can without much of a stretch alter the locators/recognizes if there are any UI changes in the application.

If not, it will wind up noticeably hard to change even one locator, as it will be utilized at a wide range of spots in test scripts.
It is constantly better to keep locators in a different record and at effectively open area. It ought to be characterized in such a way if any new individual participates amidst the venture, he/she ought to be equipped for rolling out improvements/adding any new locators to the record.

Standard:-

An essential protest vault can be executed as an accumulation of key-esteem sets, with the key being a legitimate name distinguishing the question and the esteem containing interesting articles properties used to recognize the question on a screen. For this, we will utilize a .properties record in Java which is a fundamental gathering of key-esteem sets.

Making Properties File in Eclipse:-

Step1:-

Right tap on the Package in the arrangement Explorer of Eclipse-> New - >Other

Step2:-

General - >File - >Click Next

Step3:-

Offer name to the document with .properties augmentation (Say OR_Gmail_Login.properties) - >Click Finish

Including Key/esteem Pairs in Properties File:-

Before including our items into question archive, how about we diagram a straightforward situation that we will be robotizing in Selenium:-

1. Dispatch Gmail login page.
2. Fill the Username and Password fields and tap on Submit catch
In the wake of making our unfilled properties document, now we have to include our components, as key and Value sets.

For Example:-

Gmail.LoginPage.txtPassword - > Key

Passwd->Value

With this clear instrument we have possessed the capacity to immensely diminish the measure of time required for script upkeep on the off chance that protest properties change. All it takes is a refresh of the proper sections in the question outline we're ready and run our tests once more.

About Author:

Infocampus is a best selenium training institute in Bangalore. Free demo classes will be conducting. Placement assistance will be provided as infocampus is tied up with 100+ clients.

Contact 9738001024 to get more information on Selenium Courses in Bangalore. Visit http://infocampus.co.in/best-selenium-testing-training-center-in-bangalore.html to make an enquiry.

More About the Author

best institute for selenium training in Bangalore – Infocampus. Infocampus is an excellence training center for selenium courses in Bangalore. At Infocampus, selenium training is focused on practical and real time examples. Contact Infocampus at 8884166608 or visit http://infocampus.co.in/best-selenium-testing-training-center-in-bangalore.html for complete details on selenium training.

Total Views: 406Word Count: 694See All articles From Author

Add Comment

Computer Programming Articles

1. Revolutionizing Retail: Exploring The Potential Of Digital Ticketing
Author: Attract Group

2. Maximizing Telephone Data Connectivity With Nbn: Tips And Tricks
Author: hartnettcrews

3. The Best Ways To Debug Python Programs Efficiently
Author: Dhairya Saini

4. Optimizing Integration: Salesforce To Netsuite Analytics Warehouse
Author: Yantra Inc

5. Best Full Stack Development Company In India || Rasonix
Author: Rasonix

6. Innovative Php Web Application Projects For Final Year Students
Author: sidharthh08877

7. Metaverse Beyond The Edge Of Escaping The Industrial Town
Author: Global Lancers

8. The Future Of Economic Job Market Research | Insights Into Ejmr Marketing 2024
Author: itleadz

9. Trending Machine Learning Projects For Final Year Students
Author: sidharthh08877

10. Benefits Of Google Cloud Console
Author: S. Chowdhuri

11. What Is The Use Of Google Cloud Console?
Author: S. Chowdhuri

12. The Power Of Full-stack Frameworks: Empowering Modern Web Development
Author: Adam Scott

13. Getting Started With Mern Stack Development: A Beginner's Guide
Author: Fernandez

14. Exploring The Future Of Voip: Trends To Watch Out For
Author: hartnettcrews

15. The Apache Http Server: Powering The Web For Decades
Author: Zain Ul Abidin

Login To Account
Login Email:
Password:
Forgot Password?
New User?
Sign Up Newsletter
Email Address: