Selenium WebDriver Interview Test

Practice tests are very useful for testing the level of our knowledge and skills.We get useful feedback through them about what we can do with the new learned skills at a certain moment.But practice tests show us as well what we don't know yet but should know.What follows is a real interview test for Selenium WebDriver and Java.1. Open the www.ia.ca in the Chrome browser

2. Click LOANS3. Click the Mortgages link

4. Click the Calculate Your Payments button

5. Move the Purchase Price Slider to the right6. Validate that the Purchase Price Slider movement works

7. Change the Purchase Price to 500 000 using the + button of the slider

8. Change the Down Payment to 50 000 using the + button of the slider

9. Select 15 years for Amortization

10. Select Weekly for Payment Frequency

11. Change the Interest Rate to 5%

12. Click the Calculate button

13. Verify that the weekly payments value is 836.75

Good luck doing the exercise!If you are interested in feedback, post your code in the comments section.

I used property file to store all the xpaths. I did not understand the 2 and 3 rd points . How can I add those two points in to 1. if we do then .click() event will not be present as it's work only for element. Please let me know if i am wrong

#Verifying the element to be clickablewait.until(EC.element_to_be_clickable((By.ID,"PrixProprietePlus")))# Move the Purchase Price Slider to the rightsource1 = self.driver.find_element_by_class_name('slider-track-high')action = ActionChains(self.driver)print source1.locationaction.drag_and_drop_by_offset(source1,787,629).perform()time.sleep(10)# Change the Purchase Price to 500 000 using the + button of the slidersource2 = self.driver.find_element_by_class_name('slider-horizontal')action = ActionChains(self.driver)print source1.locationaction.drag_and_drop_by_offset(source2,0,0).perform()assert "500 000" in self.driver.find_element_by_xpath("/html/body/div[3]/div[2]/div[7]/div/div[1]/div[1]/form/div[2]/div/div[2]/div/div[5]/div[3]").textwait.until(EC.element_to_be_clickable((By.ID,"MiseDeFondPlus")))

#Change the Down Payment to 50 000 using the + button of the sliderself.driver.find_element_by_id("MiseDeFondPlus").click();#Select 15 years for Amortizationwait.until(EC.visibility_of_element_located((By.NAME,"Amortissement")))select = Select(self.driver.find_element_by_name('Amortissement'))select.select_by_visible_text("15 years")#Select Weekly for Payment Frequencywait.until(EC.visibility_of_element_located((By.NAME,"FrequenceVersement")))select = Select(self.driver.find_element_by_name('FrequenceVersement'))select.select_by_visible_text("weekly")#Change the Interest Rate to 5% by clearing the previous value and enering new valuewait.until(EC.visibility_of_element_located((By.ID,"TauxInteret")))self.driver.find_element_by_id("TauxInteret").clear()self.driver.find_element_by_id("TauxInteret").send_keys("5.00")#Click the Calculate buttonself.driver.find_element_by_id("btn_calculer").click()#asserting the calculate value whther is valid or notassert "$ 836.75" in wait.until(EC.visibility_of_element_located((By.ID,"paiement-resultats"))).textself.driver.close()except Exception, e:print eself.driver.quit()raise