Page 1 of 1

Qt delegate activating

Posted: Wed Dec 22, 2021 1:20 pm
by Elena_v
Any ideas how to activate an QAbstractItemDelegate? I have in Spy TreeItem with Cell. In Qt it is an QAbstractItemDelegate, that under DoubleClick() open a QLineEdit for using. How to activate this QLineEdit without DoubleClick()? Something like myCell.As<QAbstractItemDelegate>().Edit....
P.s.: I don't use Qt legacy (plugin) and don't want to rewrite all my repos :)

Re: Qt delegate activating

Posted: Wed Dec 22, 2021 4:02 pm
by odklizec
Hi,

Could you please upload a Ranorex snapshot (NOT screenshot) of the element in question? Also, if you right click the problematic element in spy, check the available (perform) actions at bottom of the spy context menu.

Re: Qt delegate activating

Posted: Mon Dec 27, 2021 2:12 pm
by Elena_v
Unfortunately, there's too much information stored in the snapshot. I can only send you a screenshot :)

Re: Qt delegate activating

Posted: Mon Dec 27, 2021 2:39 pm
by odklizec
Hi,

As mentioned before, screenshot is useless. Have you tried to right click the cell in Spy? Are there some actions at bottom of the context menu?

Re: Qt delegate activating

Posted: Mon Dec 27, 2021 6:13 pm
by Elena_v
Thx, I know how to make a snapshot. But I have written above that it has a lot of info that I don't want to show. I described above what the element is.
I'm not even interested in this element (cell), but rather in opportunities of Ranorex +Qt in principle. I can't find any useful articles (internet) about using Ranorex for Qt test automation (incl. properties (Q_PROPERTY) and functions of Qt). But I can see that, for example, Squish (Froglogic) is developing more in this direction than Ranorex. I've been working with Ranorex for a long time. And I don't see much development with Qt...

Re: Qt delegate activating

Posted: Tue Dec 28, 2021 9:34 am
by odklizec
Hi,

Well the thing is, that Squish is a QT-based tool. So it may have somewhat better or advanced support for QT-based apps. I've tried it in the past and to be quite honest, it's no match to Ranorex Studio easiness and fast learning progress. Not to mention superb support of other UIs and technologies. And they still don't have a reasonable support forum! Even in 2021, they rely on an obsolete mailing lists :shock: I can't imagine working with a test automation tool without something that essential as community forum?

Anyway, to answer your question, Ranorex primarily interacts with apps using mouse and keyboard-based actions. However, there is also something called Invoke Actions. https://www.ranorex.com/help/latest/ran ... g-actions/
And this is why I asked for the list of actions, usually available at bottom of the Spy context menu. Simply right click the cell you are interested in (in Spy tree) and see the actions at bottom of the menu.
InvokeActions.png
You can use these via "Invoke Action" Ranorex action. Of course, the list of available actions depends on the app under test implementation. If there are no or very few actions available, then the app simply does not implement these actions and Ranorex cannot interact with the app this way.

Re: Qt delegate activating

Posted: Tue Dec 28, 2021 12:38 pm
by Elena_v
Thank for you help! I appreciate it.
I tried:

Code: Select all

  Configuration.Current["plugins.qt.legacymode"] = true;  
then I have the following:
1) I see in Ranorex Spy in Advanced Properties:

Code: Select all

 UIAutomationValueIsReadOnly = false && UIAutomationValueValue = $value
I can edit $value in Spy, but don't know how to do it in code (*.cs).
2) If right-click on an item in Spy then I have UIAutomationInvokeInvoke(UIAutomationinvoke). If I call this method, nothing happens :D
3) Also, I see in code .InvokeAction(), but where I can find a list with aviable Invoke Actions for current TreeItem?

Re: Qt delegate activating

Posted: Tue Dec 28, 2021 1:07 pm
by odklizec
Hi,

As I mentioned, the list of available actions can be found at bottom of the context menu in Spy. Also, I would suggest you to check this post, where you can find some screenshots about Invoke Action usage.
viewtopic.php?f=16&t=12324&p=49511
If you are not sure how to use InvokeAction in code, the best way is to use InvokeAction in recording module and then convert the recording action to user code. This way you can learn how to use it in code.

Re: Qt delegate activating

Posted: Tue Dec 28, 2021 10:22 pm
by Elena_v
Thank you very much for your help!