I am writing a selenium script to go to trends.google.com to compare two search terms: 'dog' and 'cat'. The problem is that in order to add the second value (cat) to compare against the first (dog), I need to click on the +compare button and then type in 'cat' in the search field that ONLY shows up when the +compare button was clicked. The problem is that any locator i used doesnt seem to work for the search field. I keep getting elementNotInteractableException.
What i tried (and failed):
- adding a wait/sleep after the click on the +Compare button
- using JavascriptExecutor to sendKeys
- used different Css/ xpath locators
I guess the element is dynamic because anytime i try to do any inspect on the search field, it automatically reverts BACK to the compare button.
Im new to programming to any advice/help would be greatly appreciated. Thanks!