Q:

Combining Java and JS executor in Selenium?

We use selenium in Java to automate our tests in our projects. Some UI pages are are developed with Angular; there selection of elements often fails and the only way to proceed with our testing is to resort to running some JavaScript (via the JS executor).
Is this approach valid or is it considered a bad practice? 

A:

If using javascript via JS executor is the only way you can access the item, then it can't be a bad practice.
Some alternatives you might like to consider, because this approach can be complex and fragile:

If you can convince the developers to ensure that each element on a page has a unique, unchanging identifier you can use that. Even if you have to get it via a custom attribute.
If you aren't able to have the developers give you something accessible, the next step is to look for the closest element in the DOM that you can access via Selenium, then go through that element's children/siblings to locate the element you need.
Don't be afraid of using a search for elements that contain a specific string. You can do something like findElements(By.TagName, "div") then within the element collection filter out the ones that contain the text you're looking for. (In C# I would use Linq: findElements(By.TagName, "div").Where(el -> el.InnerHtml.Contains("my search string")). A java expert would need to tell you how to get the same result using java).
You should be able to use multiple findElements() statements to narrow down your results. 
If nothing else works, you can then use the JS Executor for your final search or to manipulate an element that is otherwise not able to be modified (such as some date selectors that do not permit text entry: I've used selenium find methods to locate the date selector, then JS Executor to enable it in order to enter a date).

