-
Notifications
You must be signed in to change notification settings - Fork 486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
White unable to extract DataItems (ListViewRow) #241
Comments
Some additional information: Through the below code, I was able to extract the DataItem elements from the target window in the app PropertyCondition diCondition = new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.DataItem); |
I confirm it. |
Wonderful and it would be very helpful. Thanks bro..!! |
Ok, the problem is that there is no proper constructor in ListViewRow. The only one takes additional argument so the instance of this class can't be created by DictionaryMappedFactory. public ListViewRow(AutomationElement automationElement,
ActionListener actionListener,
ListViewHeader header)
: base(automationElement, actionListener)
{
this.header = header;
finder = new AutomationElementFinder(automationElement);
} For a quick fix, I can add new constructor with 2 parameters and just assign this.header = null: public ListViewRow(AutomationElement automationElement,
ActionListener actionListener)
: base(automationElement, actionListener)
{
header = null;
finder = new AutomationElementFinder(automationElement);
} @ashokkn, @JakeGinnivan would it be sufficient or we need to have the header of any ListViewRow? |
Can the ListViewHeader be looked up? How does it get passed through currently. I am not going to have a chance to look into this for a few days, and don't know the answer to your question at the moment @ilya-murzinov. Sorry |
@JakeGinnivan, I'll send a PR later tonight. |
Previously the below line of code used to throw a constructor error which was originally fixed by Ilya. TestStack.White.UIItems.ListViewRow dtItems = transactionListWindow.Get<TestStack.White.UIItems.ListViewRow>(SearchCriteria.ByControlType(ControlType.DataItem)); |
any luck on this issue ? |
Sorry, I won't have any time to look into this for a next week or so. |
Same, I have other things on my plate. If you can submit a pull request I will happily merge and do a release for you though. Cheers, |
@ashokkn, ok, I'm looking into this issue. |
@ashokkn, your code snippet
not working.
Also, I don't see any problem when trying to get DataItems in our WpfTestApplication with similar snippet
Can you please tell if there is any difference between you application and our WpfTestApplication? |
Hello
I have got a Panel in my application which contains lots of DataItem (ListViewRow) elements. Through white I am unable to extract the DataItem and perform any operation.
Screen shot 1: Shows the element DataItem through the Inspect utility, but I am unable to extract these elements through White
Screenshot 2 : Shows the error message when i try to extract the dataItem
The error message sounds to be more an issue with White itself rather I am doing anything wrong here. Kindly assist.
The text was updated successfully, but these errors were encountered: