I see two issues with your Macro:
- Before the Focus Action is executed you need to make sure the web page is open and loaded.
- There are several methods to do this.
- The simplest is just a Pause Action, of 2-3 seconds
- Here is a potentially faster, but more complex method: MACRO: Pause Until Web Page Element Exists [Example]
.
- I think you have the wrong token for the search field. Here is what works for me:
//INPUT[@id="search"]