I am trying to replicate a content check without performing one. The application under test is dynamic (object properties change with every screen). I had originally pointed five content checks to objects that I had previously recorded. Since that will no longer work (due to the discovery of the dynamic nature of the application) I am looking for help.
Is there a way to programmatically perform a content check? I used to use QTP and they had a property called "All items' that I could reference.
All ideas are welcome. Thanks in advance for the help. Talk to you soon.
Couldn't you externalize the content data [excel, csv, txt], then at the point that you have to do the content check, read in the data, then loop thru it and see if it the app.
Since there are 5 types of check, you just have to tie the external data to the specific condition that calls for that check.
I have done something similar:
Set itmProviderType = HTMLComboBox("Name=priceclaim:sel" & provType & "ProvName").Items
'Object iterates thru the collection and checks if the items in the drop-down[collection] are either street or po box
For Each objProviderType In itmProviderType
If objProviderType.Item(1) = data1 Or objProviderType.Item(1) = data2 Then
boolResults = True
verifyProviderDropDown = provType & ": Drop down content is correct"
boolResults = False
verifyProviderDropDown = provType & ": Drop-down item is: " & objProviderType.Item(1) & " And not Corporation Or Professional "
It looks like there could be several approaches to this problem.
First of all, it sounds like an object mapping problem. I'm assuming
when you say the "dynamic nature of the application" means different
object names or index number for each compile. If this is true,
tackle it from an object mapping approach.
If the contents are constant in the five checks that you mention
and object mapping doesn't help, then create a script that reads the items of each list
and writes them to Notepad. Take the notepad data, put it into your main script(or sub).
When you get to a combo box, read the contents & try to match it with the text lists
I've had a variation of this problem and reading from the list instead of the list box
solved it for me