Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error in Code while accessing WPF object
#2
Not Solved
Are you trying to retrieve the selection from your object (not sure what your AutomationPatern is and why would you do it that way)? If so then you could use next code to get it:
Code:
Window().WpfWindow().WpfList().GetSelection

This should return the value of the selected item.

Or you can use next to identify your objects and then select the item you want:
Code:
Set yourList = indow().WpfWindow().WpfList("description")
'read the list items and find the 'recordYouNeed':
listItemsCounter = yourList.GetItemsCount
For i = 1 To listItemsCounter        
    'retrieve items values:
    itemValue = yourList.GetItem(i)
    itemSelection = yourList.GetSelection
    'check if retrieved item's value is the expected one:
    If itemValue = "recordYouNeed" Then
        yourList.Select itemValue    'select the item you need
                Reporter.ReportEvent micPass, "The record 'recordYouNeed' successfully found and selected", "more details if needed"
        Exit For
    ElseIf itemValue <> "recordYouNeed" and i = listItemsCounter-1 Then
        Reporter.ReportEvent micFail, "Could not find the record 'recordYouNeed'", "more details if needed"
        ExitTest
    End If
Next
Reply


Messages In This Thread
RE: Error in Code while accessing WPF object - by lotos - 11-08-2017, 11:46 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Error while adding Object to Object repository at run time SaranKumarV 3 8,642 02-02-2015, 01:40 AM
Last Post: dubeyvin
  Error on WPF elements Autobot 2 5,417 12-09-2014, 11:27 AM
Last Post: Autobot
  UFT 11.5 throwing unspecified error while running for Delphi object rakeshsahay 0 3,809 12-25-2013, 10:43 AM
Last Post: rakeshsahay
  Error in below code snippet nilanjans 1 2,886 06-11-2013, 12:42 PM
Last Post: basanth27
  Issue in WPF Automation in QTP 11 Dinesh_cts 3 8,709 09-18-2012, 12:21 AM
Last Post: rnbhushan

Forum Jump:


Users browsing this thread: 2 Guest(s)