01-26-2011, 10:26 PM
The thing is that you have to figure out what javascript event is enabling the button. It is usually onchange, or onblur for the WebEdit. It could also be onkeydown, onkeypress, or onkeyup. When you are entering the value manually, the behavior can give you a clue as to what event to fire. If the Button does not enable until you leave the field, then it is onblur. If the button becomes enabled as you type, it could be any one of the others.
If you can't inspect the code to figure it out, which would be the most accurate way of determining what event enables the button, you can fire all the events and figure it out with trial and error. Try the below code and comment out each line and run until you figure out what event enables the button.
There are other events that could do it (like Sathiya pointed out, it could be an event on the WebButton like onfocus, but I doubt it). However, the event is most likely one of the above. More information: http://www.w3schools.com/jsref/dom_obj_event.asp
You can also try changing the ReplayType for the WebPackage:
If you can't inspect the code to figure it out, which would be the most accurate way of determining what event enables the button, you can fire all the events and figure it out with trial and error. Try the below code and comment out each line and run until you figure out what event enables the button.
Code:
Browser("").Page("").WebEdit("WebEdit").Set "test3"
Browser("").Page("").WebEdit("WebEdit").FireEvent "onchange"
Browser("").Page("").WebEdit("WebEdit").FireEvent "onblur"
Browser("").Page("").WebEdit("WebEdit").FireEvent "onkeydown"
Browser("").Page("").WebEdit("WebEdit").FireEvent "onkeypress"
Browser("").Page("").WebEdit("WebEdit").FireEvent "onkeyup"
There are other events that could do it (like Sathiya pointed out, it could be an event on the WebButton like onfocus, but I doubt it). However, the event is most likely one of the above. More information: http://www.w3schools.com/jsref/dom_obj_event.asp
You can also try changing the ReplayType for the WebPackage:
Code:
Setting.WebPackage("ReplayType")=2
Browser("").Page("").WebEdit("WebEdit").Set "test3"
Setting.WebPackage("ReplayType")=1