What are the Challenges you faced in Selenium automation? How did you solve them?
A year ago we had just started automation testing using Selenium. Our QA team was troubled with testing our React.js web app. The challenge was that the automation framework of Selenium implicitly executes for static objects, but the appearance of objects in any Single Page Applications (SPAs) like React.js, Ember.js and AngularJS is unpredictable. As a result the tests would be flaky. Simple hacks to account for waits and elements going stale may not work. And choosing the optimal locator can be tricky as the attributes can disappear during the test due to the dynamic nature of our web app. To solve this we used techniques like nested CSS algorithm for identifying dynamic objects. Built custom solution like “WaitForAngular” in Protractor can wait for async calls (Protractor works for AngularJS based pages). And used implicit and fluent waits for dynamic objects that need to be visible or interactable with predefined timeouts. We saw some success in our testin...