Web Object loses sync
Question ID: 106061
1
0

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.submit
objWebEdit.Set "HP UFT" ‘This line sometimes fails

Marked as spam
Posted by (Questions: 386, Answers: 64)
Asked on April 29, 2015 6:00 pm
32 views
Answers (1)
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.submit
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: 807)
Answered on April 29, 2015 6:00 pm
0
That fixed our issue. thanks.
( at April 29, 2015 6:01 pm)
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top