title: SeleniumJava Upcasting and Downcasting
body: <p>For some of my selenium scripts, i need to use JavaScriptExecuter and in order to use this in selenium, i need to declare JavaScriptExecutor js = (JavaScriptExecutor)driver. Kindly advise why i need to pass Webdriver reference above?
  Also to better understand this concept, can someone advise what is upcasting and downcasting in JAVA with examples. </p>