Re: dogtail-devel Determine if a gui component is selectable
- From: Cole Robinson <crobinso redhat com>
- To: Zack Cerza <zcerza redhat com>
- Cc: dogtail-devel-list gnome org
- Subject: Re: dogtail-devel Determine if a gui component is selectable
- Date: Tue, 25 Sep 2007 09:29:52 -0400
Zack Cerza wrote:
> Cole Robinson wrote:
>> Anand Subramanian wrote:
>>> Hi,
>>>
>>> We use the following bit of code, seems to work fine - please do mail back if you face any problems.
>>>
>>> It has some extra code just to print out the state-names and not just numbers off the node's stateSet.
>>>
>>> It returns a tuple because we re-use it to print out the message in the unittest framework that we have.
>>>
>>> Please find below the code, testcode and output.
>>>
>>> Thanks and regards,
>>> Anand
>> Hi Anand,
>>
>> I played with this code a bit and the general principle is useful, but
>> it doesn't address the case I presented where we want to know if a gui
>> component is present, but it is currently not open or visible. The code
>> you sent requires a 'node' object for each component to check, but you
>> cannot have a node object for an component that isn't created yet, for
>> example.
>>
>> - Cole
>>
>
> Hi Cole,
>
> I'm a little confused. If it doesn't exist, it sure can't be selectable,
> can it?
>
> Zack
I'm sure I'm obfuscating the issue with poor/inconsistent terminology,
so let me clarify.
Yes, if the component does not exist, it shouldn't be selectable. But I
would like to determine a component indeed does not exist. If I click an
'Exit' button in a window I want to be sure that window disappears, and
I also want know if a window doesn't exist when I expect it to be created.
If in a test case I expect a widget to appear but it does not and I am
using Anand's method, the tree search loops 20 times and finally throws
an exception. Granted this loop amount is probably adjustable and an
exception does notify us the widget isn't present, but I've been
focusing more on the procedural API.
I will implement the focus() boolean return as mentioned in my first
message so people can give it a spin.
- Cole
--
Cole Robinson
crobinso redhat com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]