Getting started with Selenium

TECHNOLOGY

Selenium is an open source set of libraries initially developed by ThoughtWorks. These libraries can be used with java, ruby, C#, perl, and other programming languages to interact with the web browser. Over time, selenium has evolved and became a widely used automation tool attributed to the wide community base which contributed to its enhancement, maintenance, and scalability. 

GETTING STARTED WITH SELENIUM

 

To start with selenium webdriver,Guest Posting you need to have the following items installed on your machine.
Prerequisite:

JDK (java 1.8 preferable)

Selenium libraries (Nowadays there is single jar 'selenium-server-standalone.jar' is enough unlike earlier period where we need to install multiple jars),

Browser drivers (.exe of chrome driver, ie driver, gecko driver)

 Eclipse IDE


Now that you have downloaded the minimum required elements to start writing selenium code, so let's start by setting up the environment:


Now select a java project:


Give the project name and finish.
Now configure the build path where you need to set your downloaded libraries i.e. selenium jar files, also need to set JDK and JRE path in the java compiler section. Right-click on your project and build path and configure build path.


Now select the libraries tab above and click add external jars. Add your downloaded selenium jars here:



Also now don't forget to set your compliance level as per your JDK and JRE version.
For all your latest version of selenium, make sure the compliance level under the java compiler section must be set to java 1.8 or above. Ignoring this might lead to a "class not found" run time exception during running your selenium test script.


Now that you have set libraries and compliance levels, it's time to write your first selenium code using java.
Right-click on your project and select create a new class.



Give it a name, check "public static void main.." , click finish. You are creating a sample test, where we are not using any testNG, cucumber, or maven therefore we need to include public static void main in our first class to run the test as the java execution will begin through the class where the main method is defined. In subsequent lectures, when we use testNG, cucumber, Maven, we will not use or include the main method as our execution will be taken care of by testNG or cucumber.


Now it's time to write our first test script which simply opens the browser and navigate to the site specified in the script. We'll write the code and understand the meaning of each one of them.
In our class, first include the required packages and classes which come with selenium libraries.



Now at class level, that is inside the class but before the main method, declare a webdriver instance variable:

Webdriver driver;

Now inside our main method, write code to set system property:



Here setProperty method is accepting two parameters in the form of key and value. The first one is the string parameter in which we are telling that we are going to use a chrome driver, and the second is also a string parameter where we are placing an entire path till the driver's exe.
Now in the next line, we've initialized the driver with chromeDriver. This piece of the line will open the chrome browser upon execution. Now our browser is open, and we want to navigate to any site. This task will be done by driver.get(""); method. So driver.get("") will land us to the specified URL.

INTERVIEW TIP: Why we cannot write Webdriver driver=new Webdriver();


Since webdriver is an interface therefore we can create its instance variable but cannot create its object. i.e. we cannot write Webdriver driver=new Webdriver(); this will throw error. We can rather write Webdriver driver =new FirefoxDriver(); or Webdriver driver=new ChromeDriver(); or Webdriver driver =new InternetExplorerDriver(); These FirefoxDriver, ChromeDriver, and InternetExplorerDriver are the actual classes which implement the webdriver interface and provide implementation to its methods. So we are assigning the instance variable of webdriver to its implementation classes.

 

 

SUMMARY


In this lecture, we've installed basic minimum items required for running and executing our first selenium script. We've installed JDK, eclipse, selenium libraries, drivers exe's for browsers. We've created a java project, set all the libraries in our project' build path, created a class, and imported the packages and classes needed to execute our test script. We've written the code to set system property, initialized our driver object, open the browser, and finally lands at the site specified in the driver.get("").


Source: Free Guest Posting Articles from ArticlesFactory.com

Contact Us

  • India Job Seekers
    3, First Floor, Maruthanayagam Pillai Complex, LIC Colony, KK Nagar, Trichy - 620021
  • +91 97905 55741

Quick Links

Job Categories

Job Categories

jobs near me | amazon jobs | jobs hiring near me | job alert | fast job | work from home jobs | part time jobs near me | government jobs | freelance | civil service jobs | online jobs | free job alert | work from home | apprenticeship | linkedin jobs | sbi careers | remote jobs | google jobs | part time jobs | employment | data entry jobs | google careers | amazon force | hiring near me | job search | data analyst | job vacancy | part time | software engineer | data scientist | jobs hiring | receptionist | freelance jobs | apple home advisor | majhi naukri | railway recruitment | side hustle | virtual assistant jobs | latest govt jobs | monster jobs | administrative assistant | microsoft careers | accenture careers | marriott careers | software developer | online jobs for students | free job | account manager | fast job search | post office recruitment | job bank | amazon jobs near me | apple jobs | deloitte careers | find a job | tesla careers | cashier | job alert | highest paying jobs | apple careers | receptionist jobs near me | job application | vacancies | naukri jobs | amazon work from home | icici careers | all jobs for you | online data entry jobs | full time jobs near me | qatar airways careers | aps jobs | online jobs from home | ibm careers | fci recruitment | emirates careers | sbi recruitment | glassdoor jobs | cvs careers | flight attendant jobs | trade me jobs | infosys careers | tesla jobs | work up job | government job vacancies | amazon delivery jobs | assam rifles recruitment | job seeker | work from home jobs near me | it jobs | job openings near me | govt job alert | wells fargo careers | work abroad | devnetjobsindia | railway recruitment | financial analyst | indigo careers | bsf recruitment | mechanical engineering jobs | data entry jobs from home | best jobs | government jobs | security jobs | online teaching jobs | sbi recruitment | civil engineering jobs | bank of america careers | marketing jobs | post office recruitment | apna job | jop | customer service jobs | wipro careers | upwork jobs | post office recruitment | business development manager | salesforce careers | gov jobs | rbi office attendant | construction jobs | job opportunities | assistant manager | crpf recruitment | pwc careers | customer service representative | hubstaff talent | public jobs | marketing manager | microsoft jobs | onlinedataentryjob | ey careers | transcription jobs | cisf recruitment | operations manager | sales executive | devnetjobs | amazon hiring | amazon delivery driver | remote jobs near me | railway jobs | jobs from home | amazon near me | dream job | airport jobs | amazon fulfillment center | government vacancies | kpmg careers | jp morgan careers | amazon work from home jobs | part time work from home jobs | call center jobs | cyber security jobs | kvs recruitment | mhc recruitment | executive assistant | online work from home | delivery driver jobs | flipkart careers | online jobs work from home | hr jobs | blue collar jobs | online tutoring jobs | amazon application | job sites | babysitting jobs | freelance writing jobs | online job 715 | job search sites | army jobs | cvs jobs | freelancing websites | human resources jobs | great job | barc recruitment | office work | india post recruitment | office jobs near me | ui ux designer | driving jobs near me | graphic design jobs | free alert job | recruitment online | axis bank career | recruitment agencies | transcribe me | digital marketing jobs | data analyst jobs | ibegin tcs | indian post recruitment | cognizant careers | medical assistant jobs | security jobs near me | cabin crew jobs | receptionist jobs | capgemini careers | qa engineer | iocl recruitment | latest job | account executive | computer science jobs | ikea jobs | graduate jobs | hilton careers | dfccil recruitment | online part time jobs | accounting jobs | icici bank career | career explorer | indian railway recruitment | majhi naukri | kormo jobs | babysitting jobs near me | post office vacancy | teaching jobs near me | online work | ppsc jobs | get a job | job centre | spotify careers | railway recruitment | central government jobs | management trainee | gulfwalkin | itbp recruitment | apprenticeships near me | agriculture jobs | brand manager | amazon remote jobs | new job | driving jobs | dfccil recruitment | iocl recruitment | job center | online typing jobs | we work remotely | fiverr jobs | engineering jobs | undp jobs | top jobs | job vacancy near me | construction worker | morgan stanley careers | fci recruitment | spotify jobs | cleaning jobs near me | nursing jobs near me | summer jobs | weworkremotely | cruise ship jobs | delivery jobs near me | cag recruitment | hdfc careers | drdo recruitment | bhel recruitment | part time remote jobs | data entry work from home | psc recruitment | uber careers | amazon flex driver | siemens careers | teaching jobs | finance jobs | security guard jobs | easy typing job | customer success manager | sbi po apply online | network rail jobs | electrical engineering jobs | pepsico careers | construction jobs near me | amazon driver jobs | oracle careers | job websites | pilot jobs | private job | proofreading jobs | project coordinator | system engineer | personal assistant jobs | business development executive | stay at home jobs | hsbc careers | standard bank careers | itbp recruitment | freshersvoice | home office jobs | best paying jobs in finance | ib recruitment | student at work | air force jobs | jobs hiring near me part time | salesforce jobs | amazon jobs from home | ib recruitment | ntpc recruitment | teaching assistant jobs | barc recruitment | twitter careers | remote jobs hiring | medical assistant jobs near me | esic recruitment | ubs careers | business analyst jobs | zoho careers | barclays careers | employment agencies | biotechnology jobs | creative jobs | ongc recruitment | jobsplus | dsssb vacancy | part time jobs for students | data science jobs | ssb recruitment | business administration jobs | world bank jobs | sales assistant | hal recruitment | delivery jobs | bank jobs near me | english teacher | full time jobs | indian coast guard recruitment | student job search | income tax recruitment | linkedin careers | salesforce developer | hotel jobs | administrative assistant jobs | aavin recruitment | naukri gulf | esic recruitment | typing jobs | all jobs | chase careers | maruti suzuki career | aws jobs | system analyst | cisco careers | accenture jobs | citibank careers | drdo recruitment | chemical engineering jobs | hotel jobs near me | vedantu careers | project manager jobs | production manager | new vacancy | good jobs | office assistant | noc canada | psychology jobs | night shift jobs | white collar jobs | online money earning | aai recruitment | canada post jobs | paypal careers | bartending jobs near me | hiresine | navy recruitment | freelance writing | typing jobs from home | post office vacancy | healthcare jobs | job advertisement | defence job | hdfc bank careers | adobe careers | siemens jobs | overnight jobs near me | accor careers | housekeeping jobs | high paying jobs near me | nursing jobs | ksp recruitment | honeywell careers | electrician jobs | cleaning jobs | medical representative | data entry operator | office jobs | mhada recruitment | sales engineer | pepsico jobs | logistics jobs | data entry jobs work from home | vectrus careers | credit suisse careers | arts jobs | bank of america jobs | p&g careers | accounting jobs near me | sales jobs | amazon online jobs | pharmacist jobs | state jobs | ford careers | good paying jobs | home based jobs | application for employment | deloitte jobs | dell careers | real estate jobs | mes recruitment | night jobs near me | call center jobs near me | rpa developer | cashier jobs near me | appen jobs | wells fargo jobs | bel recruitment | computer operator | top job | aai recruitment | mhada recruitment | lic recruitment | infopark jobs | linkingsky | forklift operator | local jobs | sbi clerk apply online | nestle careers | remote work from home jobs | staff nurse vacancy | remote customer service jobs | unilever careers | tcs recruitment | job openings | environmental jobs | amazon employment | enggwave | nabard recruitment | flipkart jobs | creative circle | stackoverflow jobs | factory jobs near me | sap careers | job fairs near me | hckrecruitment | hospital jobs | work from home jobs without investment | writing jobs | ibm jobs | journalism jobs | machine operator | cisco jobs | environmental science jobs | jobs for freshers | hcl careers | airbnb careers | sap jobs | medical transcriptionist | best paying jobs | gis jobs | blackrock careers | part time jobs from home | i need a job | government job vacancy | psu jobs | relationship manager | work from home jobs no experience | software engineer jobs | hr jobs near me | stripe careers | job vacancies | jobassam | bookkeeping jobs | overnight jobs | public relations jobs | ssb recruitment | part time work near me | emirates group careers | sbi recruitment | truck driving jobs | public service commission jobs | igcar recruitment | sbi clerk apply online | admin jobs | olx jobs | manpower jobs | vistara careers | find an apprenticeship | remote data entry jobs | social media jobs | marriott jobs | ikea careers | it jobs near me | npcil recruitment | intel careers | new jobs | research assistant jobs | job offer | kvs vacancy | hospitality jobs | territorial army recruitment | sbi vacancy | amazon hiring near me | job boards | hgv driver jobs | government jobs | aai recruitment | becil recruitment | lionbridge jobs | sales jobs near me | pwc jobs | tamilanguide | career change | it technician | information technology jobs | airline jobs | medical coding jobs | vmware careers | job posting | night shift jobs near me | interior design jobs | etihad careers | job market | unacademy careers | best work from home jobs | indgovtjobs | tata steel career | healthcare administration jobs | cg govt job | student jobs | aviation jobs | microbiology jobs | transcriber | highest paying jobs in the world | data entry jobs near me | hgv jobs | hospital jobs near me | summer jobs near me | myntra careers | bloomberg careers | up police vacancy | computer engineer | forklift jobs | amazon customer service jobs | intel jobs | web developer jobs | jll careers | business intelligence analyst | wfh jobs | psc jobs | railway vacancy | bel recruitment | housekeeping jobs near me | transcriptionist | bmw jobs | nmdc recruitment | job search engines | good work | no experience jobs | railway jobs | psssb recruitment | typist | best paying jobs in basic industries | looking for a job | management jobs | sbi recruitment apply online | administrative officer | startup jobs | government jobs near me | freelance work | job agencies near me | latest govt jobs | us bank careers | forklift jobs near me | nature jobs | trade jobs | good paying jobs near me | train driver jobs | online jobs for students to earn money at home | graduate schemes | deutsche bank careers | part time work from home | work from home jobs for freshers | front desk jobs near me | dubizzle jobs | vacancy | tutoring jobs | admin jobs near me | amazon part time jobs | air force vacancy | paytm careers | senior manager | bank recruitment | npcil recruitment | indian railways recruitment | union jobs | computer technician | today jobs | copywriting jobs | iaf recruitment | delivery driver | oracle jobs | ux researcher | coinbase careers | legal jobs | information security analyst | amazon distribution center | supply chain manager | infosys recruitment | no experience jobs near me | delivery driver jobs near me | cbre careers | tamilan jobs | supply chain management jobs | punjab police jobs | manager jobs near me | category manager | new vacancy | all job for you | mba jobs | green jobs | social worker jobs | market research analyst | twitter jobs | data scientist jobs | online part time jobs for students | lorry driver | workday careers | swiggy careers | iqvia careers | side jobs | at home jobs near me | new job alert | social media manager jobs | zomato careers | registered nurse jobs near me | administration jobs | oil and gas jobs | procurement manager | shine jobs | nmdc recruitment | jobline | electrician jobs near me | amazon job application | free job posting sites | genpact careers | offcampusjobs4u | jobs around me | biomedical engineering jobs | igcar recruitment | security officer | online data entry | nielit recruitment | jobs abroad | iti jobs | gulf jobs | axis bank recruitment | best paying jobs in technology | hdfc bank recruitment | fao jobs | us postal service jobs | best job search engines | nvidia careers | icici bank recruitment | slack careers | whitehat jr jobs | study job line | admin assistant | adp careers | trainee train driver | job hunting | work from home jobs for students | southern railway recruitment | cvs application | online writing jobs | tech mahindra careers | army jobs | it engineer | sap consultant | amazon recruitment | byju's jobs | highest paying jobs without a degree | police jobs | ppsc jobs | safety officer jobs | cg job | online jobs no experience | texco vacancy | nithra jobs | hiring manager | online jobs near me | tcs jobs | engineering manager | data entry clerk | production assistant | public service jobs | assam rifles recruitment | hssc recruitment | jobs | abb careers | income tax department recruitment | local jobs near me | freelance jobs online | nyks recruitment | education jobs | find a job gov | adnoc careers | employment agencies near me | apple work from home | shell careers | quality engineer | hilton jobs | international relations jobs | librarian jobs | india post recruitment | job recruitment | department of health vacancies | career options | kpmg jobs | ntpc recruitment | job search websites | credit analyst | kbr careers | zoom careers | cs jobs | railway recruitment apply online | self employed jobs | intelligence bureau recruitment | nestle jobs | career choices | remote working jobs | sales development representative | people first jobs | medical jobs | analyst jobs | night jobs | vodafone careers | overseas jobs | upsc recruitment | uber jobs | madras high court recruitment | part time work | ncl recruitment | procurement jobs | online jobs hiring | bandhan bank recruitment | social media marketing jobs | communications jobs | aavin recruitment | linkedin job search | offline vacancy | chemistry jobs | qatar careers | software developer jobs | pharmacist jobs near me | mechanic jobs near me | mastercard careers | financial analyst jobs | medical transcription jobs | visa careers | amazon apply | job applications near me | aws careers | medical receptionist jobs | supply chain jobs | call center agent | front end developer jobs | staff nurse | coding jobs | easy jobs | intelligence bureau recruitment | public administration jobs | jobs for introverts | tuition teacher | bro recruitment | hotel career | wipro recruitment | marketing jobs near me | construction manager | staff nurse vacancy | jobs near me for freshers | yes bank careers | list of jobs | tamilan guide | ey jobs | remote nursing jobs | marketing specialist | byju's careers | office assistant jobs | govt jobs | freelancing sites | marketing coordinator | fiverr freelance | railroad jobs | office worker | aavin recruitment | oil india limited recruitment | hr specialist | job net | paypal jobs | clerical work | abbott careers | careers near me | digital marketing manager | security guard jobs near me | offshore jobs | canada post careers | side hustle jobs | job agencies | nhpc recruitment | psc vacancies | ongc recruitment | shop assistant | cvs health careers | bp careers | cash jobs near me | accounts payable jobs | kpsc recruitment | railway vacancy | recruitment consultant | amazon flex jobs | marketing assistant | oil india recruitment | intuit careers | remote accounting jobs | qualcomm careers | health career | pharmaceutical sales jobs | airbus careers | virtual jobs | jkssb recruitment | local truck driving jobs | modeling jobs | psc vacancies | delivery manager | executive assistant jobs | kotak mahindra bank career | ossc recruitment | government vacancies | anz careers | border force jobs | computer teacher vacancy | gail recruitment | chef jobs | job postings | idbi bank recruitment | local government jobs | sales coordinator | private bank jobs | oil rig jobs | flipkart job vacancy | first job | caterpillar careers | best jobs in the world | jpmorgan chase careers | kbr jobs | flydubai careers | engineering apprenticeships | maersk careers | air arabia careers | business jobs | science jobs | qa analyst | etihad airways careers | post office recruitment apply online | product manager jobs | senior consultant | mes jobs | ppsc online apply | senior software engineer | teleperformance jobs | cargill careers | hr assistant jobs | hostess jobs near me | sbi recruitment apply online | day labor near me | job apps | health and safety jobs | teacher vacancy | top jobs | all govt jobs | social work jobs near me | computer engineering jobs | indian railways recruitment | operations manager jobs | best part time jobs | best remote jobs | manufacturing jobs | career times | public sector jobs | philips careers | cashier jobs | amazon india careers | front desk receptionist | research jobs | procurement specialist | job hiring | customer service jobs near me | online data entry jobs without investment | online jobs for students to earn money | work near me | amazon delivery driver jobs | full stack engineer | new job vacancy | offline vacancy | hr assistant | axis bank recruitment | concentrix jobs | jobs hiring near me full time | sales clerk | office work near me | tech jobs | side jobs from home | tnstc recruitment | employment opportunities | gov nokri | world bank careers | service delivery manager | best freelance websites | iti jobs beta | chase bank careers | airbnb jobs | low stress jobs | aiims recruitment | clara jobs | air canada careers | new govt jobs | airtel careers | atlassian careers | bus driver jobs | cyber security analyst | computer jobs | bank of baroda recruitment | general motors careers | medical billing and coding jobs | vacancy near me | medical receptionist | kormo | freelance graphic designer | find jobs near me | job shop | workday jobs | pgcil recruitment | logistics manager | stripe jobs | khaleej times jobs | product specialist | digital marketing specialist | concentrix careers | job ideas | workindia job | real estate jobs near me | legal secretary | online english teaching jobs | translator jobs | dice jobs | technician jobs | night auditor | work from home customer service jobs | biology jobs | bnp paribas careers | logistics coordinator | job desk | emaar careers | nlc careers | truck driving jobs near me | amazon glassdoor | reliance careers | merchant navy jobs | fleet manager | digital nomad jobs | security analyst | cvs hiring | jobkind | law jobs | oil india recruitment | bsf recruitment | amazon canada jobs | indian coast guard recruitment | baker hughes careers | resdex naukri | barclays jobs | application engineer | best online jobs | product marketing manager | rpf vacancy | wellsfargo careers | rbi careers | room attendant | rotana careers | project coordinator jobs | al futtaim careers | indian railway jobs | jobs after 12th | ernst and young careers | media jobs | unilever jobs | executive engineer | amazon career day | chef jobs near me | marketing analyst | acting jobs | international jobs | drdo recruitment | ubs jobs | design jobs | traffic control jobs | reed recruiter | amazon recruitment | inova careers | legal assistant jobs | kpsc recruitment | hotel manager | astrazeneca careers | upsc vacancy | department of education jobs | tata motors career | fast jobs | brand ambassador jobs | coal india recruitment | canadian job bank | lorry driver jobs | payroll jobs | factory worker | carpenter work | healthcare management jobs | google work from home | online data entry jobs without investment daily payment | home based work | cag recruitment | kmf recruitment | government jobs after 12th | graphic design jobs near me | top paying jobs | best jobs for introverts | apprenticeship programs | noc engineer | ecil recruitment | industrial engineering jobs | sbi careers | job centre online | online jobs without investment | exxonmobil careers | property management jobs

© 2024 India Job Seekers.