Forum Discussion

jloyzagawh's avatar
jloyzagawh
Contributor
9 years ago

how to define an object (button) that has a text value associated with it

I have a button that has an exact text to test "textA" because when pressed it still remains visible with the text being "textB" and I need to check if its available as "textA"

 

perhaps the other way to test is to check whether "textB" exists on the page -

 

so either or both would help me

 

its using WPF and this is the definition

Aliases.SportingBet_Intrabet.HwndSource_IntrabetMainWindow.IntrabetMainWindow.Grid.Grid.windows.eventManagement.grdMain.Grid.tabControl.ScrollViewer.Grid.contentEventSummary.Grid.Grid.StackPanel.eventCheckList.pnlEventChecklist.ItemscontrolEventsChecklist.eventChecklistSettlingItem.Grid.Button

 

testcomplete 11 trial

  • NisHera's avatar
    NisHera
    Valued Contributor

    inspect that button with object spy

    It should have property something like Text  of Caption whos value is either textA or textB

    so you may write something like 

    IF .........Grid.Button.Caption ="textA"

    do onething

    ELSE 

    do other thing