1. A method for a scripting application, comprising: identifying, by a processor, user interface (UI) objects of a browser hosted application; assigning, by the processor, roles to the identified UI objects; identifying UI object patterns in the browser hosted application; assigning roles to the identified UI object patterns; selectively assigning multiple roles to a single UI object pattern; selectively recording, by the processor, in a script file user actions on the UI objects based on the assigned roles; and performing, by the processor replay operations based on the user actions selectively recorded in the script file.