Web Object loses sync

Question ID: 106061

We are using descriptive programming in our web application. Sometimes, after we’ve created an object such as objWebEdit and the page reloads, UFT seems to ‘lose sync’ with the object. Does anyone know how to regain sync? Using Google.com as an example:

Set objBrowser = Browser("Google")
Set objWebEdit = objBrowser.WebEdit("name:=q", "index:=0")
objWebEdit.Set "Orasi Software"
objWebEdit.Set "HP UFT" ‘This line sometimes fails

Marked as spam
Posted by (Questions: 344, Answers: 24)
Asked on April 29, 2015 6:00 pm
Answers (1)
Private answer

Try using the undocumented .Init method. It re-links the test object to the runtime object:

Set objBrowser = Browser(''Google'')
Set objWebEdit = objBrowser.WebEdit(''name:=q'', ''index:=0'')
objWebEdit.Set ''Orasi Software''
objWebEdit.init 're-link test and runtime object
objWebEdit.Set ''HP UFT'' 'This line won't fail anymore

objWebEdit.RefreshObject may also work.

Marked as spam
Posted by (Questions: 16, Answers: 754)
Answered on April 29, 2015 6:00 pm
That fixed our issue. thanks.
( at April 29, 2015 6:01 pm)