Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Gui testing with dogtail

    3rd Party Software
    1
    1
    1896
    Loading More Posts
    • 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
      srehm last edited by

      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 Reply Quote 0
      • First post
        Last post