Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. Gui testing with dogtail
Qt 6.11 is out! See what's new in the release blog

Gui testing with dogtail

Scheduled Pinned Locked Moved 3rd Party Software
1 Posts 1 Posters 2.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    srehm
    wrote on last edited by
    #1

    Hi,

    I am currently experimenting ways to do some automated gui testing under Ubuntu 12.04 (Qt 4.8.1). One of the first problems I discovered was, that I am not able to read the text of e.g. a QPlainTextEdit control -> the 'Text' value in dogtails sniff is always empty regardless of what I type in the control.
    So I went and implemented a custom accessible object
    @
    class MyAccessiblePlainTextEdit : public QAccessibleWidget
    {
    public:
    MyAccessiblePlainTextEdit(QWidget *w);

    virtual QString text(Text t, int child);
    virtual int childCount() const;
    virtual Role role(int child) const;
    

    private:
    QPlainTextEdit* textEdit() const;
    };

    QString MyAccessiblePlainTextEdit::text(Text t, int child) const
    {
    if (!child)
    {
    if (t == QAccessible::Value)
    {
    return this->textEdit()->toPlainText();
    }
    if (t == QAccessible::Name)
    {
    return this->textEdit()->accessibleName();
    }
    }

    return QString();
    

    }

    ...
    @

    and installed a suitable factory via QAccessible::installFactory in the main funtion of my test program.
    However, the text method is only called with t := QAccessible::Name, t := QAccessible::Description etc. but never with t := QAccessible::Value. So while I am able to change e.g. the name or the description, I still dont get the text :-(.

    Am I missing something? Any help would be greatly appreciated. Thanks in advance.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved