I have automated classis view in salesforce but in lightning view same elements are not recognizable by selenium webdriver. VF embedded controls are not recognizable in lightning mode
Selenium logic is very fragile as it is usually based on small details of the HTML.
A Visualforce page rendered in "Classic" has header and sidebar HTML added and is rendered as the root
html element. A Visualforce page rendered in "Lightning Experience" doesn't have the header and sidebar HTML added and is rendered in an
iframe contained in the root
... <iframe class="" frameborder="0" width="100%" name="vfFrameId_1501838247943" height="100%" id="vfFrameId_1501838247943" scrolling="yes" data-aura-rendered-by="3029:0" allowfullscreen="true"> <html class> ... </html> </iframe> ...
Other changes are also made by the platform to keep the Visualforce working in the considerably different "Lightning Experience" world such as URLs modified to e.g.:
Modifying your Selenium logic to work for both modes is a significant job event if the logic is well structured; if the logic was created by e.g. recording you will probably need to completely re-create it.