Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Object Name changes every time
#2
Not Solved
use DP to search for the text of the checkbox to set, then the name won't matter.

Code:
Dim chkobj
Set chkobj= Description.Create()
chkobj("html tag").Value = "input"
chkobj("type").Value = "checkbox"
chkobj("text").Value =  "" 'text you need here...removing this will return all checkboxes on a page as an array that you can loop through below.

dim myobjs
set myobjs = Browser("Browser").Page("Page").ChildObjects(chkobj)
myobjs.set "ON"  'change to myobjs(id).Set "ON" if returning an array of objects.
the above code might not be perfect. I have 5 or 6 functions in a framework that combine functionality to return arrays of objects from the pages and then make decisions on which one I am looking for based on multiple critieria, so I had to strip all that down into this simple code. Hope this helps and points you in the right direction.
Reply


Messages In This Thread
RE: Object Name changes every time - by jsknight1969 - 03-25-2010, 02:05 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Object identification is taking too much time JACKSPARROW 0 1,698 01-17-2017, 11:08 AM
Last Post: JACKSPARROW
  QTP not recogonising object during run time Lavanya N 2 3,723 10-28-2015, 12:46 PM
Last Post: vinod123
  Object not recognising at run time srtanniru.test 2 2,448 12-16-2010, 05:07 AM
Last Post: srtanniru.test
  At run time, object could not be found by QTP (WinListView) thotamurali 7 9,058 11-19-2010, 08:46 PM
Last Post: thotamurali
  find the property value of a run time object reejais 3 3,349 10-28-2010, 04:27 PM
Last Post: reejais

Forum Jump:


Users browsing this thread: 1 Guest(s)