Hi Jian,
I tried with the minimum possible attributes to identify UI elements, but
it's not working. I'm noticing very unusal behaviour while execution of test
cases. i.e some times it's able to find the UI element for a given UI module
and for the same UI module it sometimes will not find the UI element.
I will illustrate it below:
Here is the HTML code:
*
*
<table class="top-bar-force" cellspacing="0" cellpadding="0" border="0"
width="100%">
<tbody>
<tr>
<td nowrap="" width="1%" valign="top">
<div class="logo-force" align="center">
<img src="img.png" alt="IMG"/>
</div>
</td>
<td class="qs" nowrap="" width="5%">
<input id="quickSearchBox" class="sx cgy" type="text"
onfocus="onFocusQuickSearchBox()" onkeydown="someevnt" style="border: 1px
solid darkgray; padding: 2px; width: 200px; margin-left: 21px;" value="QA#,
smart tag or DQL" name="quickSearchBox"/>
<input class="s" type="button" onclick="quickSearch(event)"
value="Search QA#"/>
<img class="chelp" onmouseover="tooltip ({ content:
getQuickSearchToolTip(), maxWidth:400, elem : this });" src="green_info.png"
alt=""/>
</td>
<td class="s" nowrap="" align="center" width="79%">
<span class="l" style="color: brown;"
onclick="loadNewFeaturesPage()" onmouseout="this.style.textDecoration='';"
onmouseover="this.style.textDecoration='underline';">
<span id="new_features" style="font-weight: bold;">New
Features</span>
<span id="new_features_snippet">
:
<span onclick="loadNewFeatureLink();">Changes to private
fields</span>
</span>
</span>
</td>
<td nowrap="" align="right" width="5%" valign="top">
<div class="app-bar">
<span style="display: none;">
<a href="">Progress Reporting</a>
</span>
<a target="_blank" href="http://inout.nyc.deshaw.com/
">Inout</a>
</div>
</td>
</tr>
</tbody>
</table>
*I have highl-lighted the code which i'm interested in with red colour*
*
*
**
When i recorded this with TrUMP the following code got generated:
Container(uid: "root", clocator: [tag: "table", class: "top-bar-force"]){
InputBox(uid: "input0", clocator: [tag: "input", type: "text", id:
"quickSearchBox"] )
InputBox(uid: "input1", clocator: [tag: "input", type: "button", class:
"s"] )
}
i have trimmed the attributes as u had mentioned.
and based on this, my function looks as below
public void typeAndPress(String key){
type "root.input0", key
click "root.input1"
waitForPageToLoad 20000
}
when i executed this code from a JUnit Test case. it gave me the following
error:
com.thoughtworks.selenium.SeleniumException: ERROR: Element
//descendant-or-self::tab...@class="top-bar-force"]/descendant-or-self::inp...@type="text"
and @id="quickSearchBox"] not found
*
*
*Later *i tried the following code:
Container(uid: "root", clocator: [tag: "table", class: "top-bar-force"]){
InputBox(uid: "input0", clocator: [tag: "input", type: "text", id:
"quickSearchBox"] )
}
public void typeAndPress(String key){
type "root.input0", key
waitForPageToLoad 20000
}
This piece of code got executed without any error for the first time, but
later (that is i did certain modificaions to the UI module which didn work
again and then iit gave me the following error, (this is
unusual)com.thoughtworks.selenium.SeleniumException:
ERROR: Element
//descendant-or-self::tab...@class="top-bar-force"]/descendant-or-self::inp...@type="text"
and @name="quickSearchBox"] not found
*
*
i modified the UI Module:
ui.Table (uid:"firstTable", clocator: [class: "top-bar-force"]){
InputBox(uid: "row:1,column:2", clocator: [tag: "input", type: "text",
id: "quickSearchBox"] )
Button(uid: "row:1,column:2", clocator: [tag: "input", type: "button",
class: "s"] )
}
public void typeAndPress(String key){
type "firstTable[1][2]", key
click "firstTable[1][2]"
waitForPageToLoad 20000
}
when i executed this piece of code, i got the following error:
groovy.lang.MissingMethodException: No signature of method:
org.tellurium.object.UiObject.type() is applicable for argument types:
(java.lang.String, org.tellurium.dsl.BaseDslContext$_type_closure8) values:
[5164, org.tellurium.dsl.basedslcontext$_type_closu...@11edceb]
*
*
Then i tried the following:
ui.Table (uid:"firstTable", clocator: [class: "top-bar-force"]){
InputBox(uid: "row:1,column:2", clocator: [tag: "input", type: "text",
id: "quickSearchBox"] )
} public void typeAndPress(String key){
type "firstTable[1][2]", key
waitForPageToLoad 20000
}
This piece of code got executed without any error for the first time but
later it gave me the following error, (this is unusual)
com.thoughtworks.selenium.SeleniumException: ERROR: Element
//descendant-or-self::tab...@class="top-bar-force"]/tbody/tr[child::td][1]/td[2]/descendant-or-self::inp...@type="text"
and @id="quickSearchBox"] not found
*
*
**
I'm not able to define the UI Modules on myself ( especially for container,
tables and frames ), looking at the DOM structure please help me out with
this. I went through the User guide, but its not explained in detail there.
I think i will able to work faster if i get to know how exctly tellurium
behaves for each of these UI elements (tables, frames, container ) and why
the error has occured.
please respond me ASAP.
Thanks,
Prasanna
On Tue, Sep 1, 2009 at 7:21 PM, Jian Fang <[email protected]> wrote:
> Well, seem you include some attributes that you shouldn't, for example,
> onkeydown and onfocus, which are really only for Javascript events. As I
> said in the previous post, try to use as few attributes as possible to
> locate UI elements.
>
> Thanks,
>
> Jian
>
>
> On Tue, Sep 1, 2009 at 4:06 AM, prasanna bhat <[email protected]>wrote:
>
>> Hi Jian,
>>
>> I'm getting this exception from selenium server, can u please help me
>> understand this.
>>
>> com.thoughtworks.selenium.SeleniumException: ERROR: Element
>> //descendant-or-self::tab...@class="top-bar-force"]/descendant-or-self::inp...@type="text"
>> and @onfocus="onFocusQuickSearchBox()" and
>> @onkeydown="onKeyDownQuickSearch(event)" and @value="QA#, smart tag or DQL"
>> and @name="quickSearchBox" and @id="quickSearchBox" and @class="sx cgy cbk"]
>> not found
>>
>> does this have anythin to do with my selenium server or it's actually a
>> problem with my code itself.
>> Because there is absolutely no problem in TrUMP recording.
>> I didn not find any "X" tag during recording.
>>
>> Please reply asap.
>> thanks,
>> Prasanna
>>
>>
>>
>> On Sat, Aug 29, 2009 at 12:52 AM, Jian Fang <[email protected]>wrote:
>>
>>> Thanks to Vivek for the quick fix. Please download the latest snapshot
>>> from
>>>
>>>
>>> http://kungfuters.org/nexus/content/repositories/snapshots/tellurium/TrUMP/0.2.0-SNAPSHOT/TrUMP-0.2.0-20090828.142733-7.xpi
>>>
>>> and install it. You should be able to record now.
>>>
>>> The frame/iframe support still needs more work.
>>>
>>> Thanks,
>>>
>>> Jian
>>>
>>>
>>> On Fri, Aug 28, 2009 at 9:24 AM, Mahendra Kariya <
>>> [email protected]> wrote:
>>>
>>>> Which version of Firefox are you using? There are a few problems with
>>>> the latest version and we are working on it.
>>>>
>>>> Regards,
>>>> Mahendra Kariya
>>>> http://www.mahendrakariya.blogspot.com
>>>>
>>>>
>>>>
>>>> On Fri, Aug 28, 2009 at 12:52 PM, prasanna bhat <
>>>> [email protected]> wrote:
>>>>
>>>>>
>>>>> Hi,
>>>>>
>>>>> I'm a novice tester. I have started using tellurium testing
>>>>> framework recently and i would like to thank all of you who are
>>>>> involved in this project for providing such vast amount of resources
>>>>> and information at projects website.
>>>>> I'm able to execute sample examples (using Eclipse and Junit) which
>>>>> were posted in the tellurium home page and also i tried few examples
>>>>> on my own.
>>>>>
>>>>> The problem i'm facing is this:
>>>>> I'm able to record UI on few web pages, but i'm not able to record
>>>>> Google home Page (http://www.google.co.in) and also i need to test my
>>>>> web application, whose UI is also not getting recorded with TrUMP.
>>>>>
>>>>> the log generated by TrUMP looks like this
>>>>>
>>>>> * [error] uiModelArray is not defined, cannot generate source!
>>>>> * [warn] The root node in the Tree is null
>>>>>
>>>>> please help me with this.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"tellurium-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/tellurium-users?hl=en
-~----------~----~----~----~------~----~------~--~---