Is there a way to force a reload or refresh of the DOM if objects dynamically change on a page?
I'm using the following code inside a sub to put all the radio buttons from a particular page into an array:
<font class="small">Code:</font><hr /><pre>Set cInputObj = oPage.Object.all.tags("INPUT")
i = 0
For Each Element In cInputObj
If Element.getAttribute("type")="radio" Then
ReDim Preserve aRadioValues(i)
aRadioValues(i) = Element.Value
i = i + 1
Next </pre><hr />
I then click on one of the radio buttons which dynamically enables other radio buttons on the same page. When I come back into this function to select the next radio button (that wasn't there previously) this code doesn't detect the new radio button.
I have an oPage.Sync before this code in the sub but that doesn't appear to help. I'm assuming because no actual navigation happened.
Also, the application I'm testing doesn't handle browser refreshing well, so I can't use object.Refresh to solve the problem.
Thanks for the clarification Tarun. Based on what you said I simply added a Wait(1) before executing the above code and that appears to delay the script enough to get the new objects from the updated DOM. Apparently the script was just executing faster than the DOM was being updated.
My response is that I agree that the DOM should be up to date all the time, but I am certain that it is NOT. I have a small html document in which I change the source of an "embed" tag to load different music playlists, which should work (in fact the books say it does). It works in FireFox, but not in Internet Explorer. I just cannot figure out HOW to get IE to reload my "embed" element, because it does not update it when I change the src attribute.
You are more than welcome to have a look; it is stored here: