Re: Querying top panel widget positions?
ken <[email protected]> Sun, 21 Mar 2021 10:45:28 +0000
| Newsgroups | gmane.comp.gnome.general |
|---|---|
| Message-ID | <[email protected]> |
--===============7499558002084277524== Content-Type: multipart/alternative; boundary="----R4BG4F8DCHRCCH37KRWMYLWUYWA7MI" Content-Transfer-Encoding: 7bit ------R4BG4F8DCHRCCH37KRWMYLWUYWA7MI Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On March 21, 2021 1:27:20 AM UTC, Chris Spencer via gnome-list <gnome-list@= gnome=2Eorg> wrote: >Hi, > >Is there any way to programmatically lookup the position of widgets >displayed in the Gnome top panel, as well as UI elements within those >widgets? > >I'm trying to build a UI test automation framework for some Gnome Shell >panel widgets=2E I'd like to write a script that can click on a panel >widget, confirm a popup appears, verify certain text exists in the >popup, etc=2E > >I maintain a Gnome Shell extension, and it's become immensely >expensive, not to develop, but to test and maintain=2E There are so many >different distros with varying incompatible Gnome versions, and testing >them all by hand is virtually impossible=2E Fixing a bug for one Gnome >version introduces a bug in another version=2E It's gotten to the point >where I almost have to abandon the project because it's too difficult >to do basic integration and regression testing on Gnome, but I really >want to find a solution=2E > >Gnome is one of the most widely used desktop environments in the world, >so I find it hard to believe no one else has encountered this problem >befpre=2E > >I've found some tools like xdotool and pyautogui for programmatically >clicking elements=2E However, without knowing exactly where widgets are >rendered, the script would be clicking blind=2E And even if I could >reliably click a location, those tools don't let me read DOM values for >the UI elements at that location=2E > >I've also found some tools like xwininfo that can query some window >positions and do a little introspection, but this seems specific to X >and treats the entire top panel as one huge window, with no ability to >introspect any of the widgets inside of it=2E > >I had hoped the Dogtail project might be helpful in this regard, but it >seems to be dead with virtually no documentation=2E I was able to build >it, but I couldn't find any ability within it to introspect the top >panel=2E > >Are there any other tools or libraries I could potentially use? Does >anyone have any alternate suggestions for how I might automate Gnome UI >testing? > >Regards, >Chris Chris, I might be talking way over my head, and I haven't had my first cup= of coffee yet, but speaking just with a little programming experience behi= nd me, I'm guessing that there must be a shared library or two which has th= e code that creates the widgets which are displayed in the top panel=2E Som= e code could be added to that Library which logs that particular event when= the widget is created in the top panel, or moved within that top panel, or= deleted from it=2E That logging ability would not need to be existent in t= hat shared library for the whole distro, you just need to have it on your o= wn machine for its testbed environment=2E I hope this little project turns out to be a lot more fun than I've made i= t sound=2E :) ------R4BG4F8DCHRCCH37KRWMYLWUYWA7MI Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable <html><head></head><body><div class=3D"gmail_quote">On March 21, 2021 1:27:= 20 AM UTC, Chris Spencer via gnome-list <gnome-list@gnome=2Eorg> wrot= e:<blockquote class=3D"gmail_quote" style=3D"margin: 0pt 0pt 0pt 0=2E8ex; b= order-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"> <div>Hi,<br></div><div><br></div><div>Is there any way to programmatically= lookup the position of widgets displayed in the Gnome top panel, as well a= s UI elements within those widgets?<br></div><div><br></div><div>I'm trying= to build a UI test automation framework for some Gnome Shell panel widgets= =2E I'd like to write a script that can click on a panel widget, confirm a = popup appears, verify certain text exists in the popup, etc=2E<br></div><di= v><br></div><div>I maintain a Gnome Shell extension, and it's become immens= ely expensive, not to develop, but to test and maintain=2E There are so man= y different distros with varying incompatible Gnome versions, and testing t= hem all by hand is virtually impossible=2E Fixing a bug for one Gnome versi= on introduces a bug in another version=2E It's gotten to the point where I = almost have to abandon the project because it's too difficult to do basic i= ntegration and regression testing on Gnome, but I really want to find a sol= ution=2E<br></div><div><br></div><div>Gnome is one of the most widely used = desktop environments in the world, so I find it hard to believe no one else= has encountered this problem befpre=2E</div><div><br></div><div>I've found= some tools like xdotool and pyautogui for programmatically click= ing elements=2E However, without knowing exactly where widgets are rendered= , the script would be clicking blind=2E And even if I could reliably click = a location, those tools don't let me read DOM values for the UI elements at= that location=2E<br></div><div><br></div><div>I've also found some tools l= ike xwininfo that can query some window positions and do a little intr= ospection, but this seems specific to X and treats the entire top panel as = one huge window, with no ability to introspect any of the widgets inside of= it=2E<br></div><div><br></div><div>I had hoped the Dogtail project might b= e helpful in this regard, but it seems to be dead with virtually no d= ocumentation=2E I was able to build it, but I couldn't find any ability wit= hin it to introspect the top panel=2E<br></div><div class=3D"protonmail_sig= nature_block protonmail_signature_block-empty"><div class=3D"protonmail_sig= nature_block-user protonmail_signature_block-empty"></div><div class=3D"pro= tonmail_signature_block-proton protonmail_signature_block-empty"><br></div>= </div><div><br></div><div>Are there any other tools or libraries I could po= tentially use? Does anyone have any alternate suggestions for how I might a= utomate Gnome UI testing?<br></div><div><br></div><div>Regards,<br></div><d= iv>Chris</div></blockquote></div><br clear=3D"all">Chris, I might be talkin= g way over my head, and I haven't had my first cup of coffee yet, but speak= ing just with a little programming experience behind me, I'm guessing that = there must be a shared library or two which has the code that creates the w= idgets which are displayed in the top panel=2E Some code could be added to = that Library which logs that particular event when the widget is created in= the top panel, or moved within that top panel, or deleted from it=2E That = logging ability would not need to be existent in that shared library for th= e whole distro, you just need to have it on your own machine for its testbe= d environment=2E<br><br>I hope this little project turns out to be a lot mo= re fun than I've made it sound=2E :)</body></html> ------R4BG4F8DCHRCCH37KRWMYLWUYWA7MI-- --===============7499558002084277524== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ gnome-list mailing list [email protected] https://mail.gnome.org/mailman/listinfo/gnome-list --===============7499558002084277524==--