Hi
  I am Just attaching the entire project and the xforms file for reference

The xforms file is called test3.xhtml .  u can copy this to the root of your
web server . (and modfy the connectUrl line in Test01.groovy )

 I run the selenium server as

java -jar selenium-server.jar -port 4440 -firefoxProfileTemplate
c:\mozilla\myTemplate -userExtensions userExtensions.js

On the firefox client you need to search for the xforms plugin and intall
(It works on Ubuntu 8.04 32 bit , Windows )

running ant should print a failure saying invalid xpath. If you make the
change in the selenium-serverbot.js and repackage the jar and then run again
things are fine

I could not figure out why the nsFromMap is null

Regards
Hari

On Sat, May 16, 2009 at 5:41 PM, Harihara Vinayakaram <[email protected]>wrote:

> Hi Jian
>    I have attached a test3.xhtml which is a xform page . You need to enable
> the XForm add-on in Mozilla .
>
>    I debugged the problem and found the problem is in the namespaceResolver
> in the selenium-serverbot .js . I commented out your code
> (nsFromMap.get(prefix) ) and put the old code back in with xforms
>
>  if (prefix == 'xhtml') {
>       return "http://www.w3.org/1999/xhtml";;
>     } else if (prefix == 'xf' || prefix == 'xforms') {
>       alert ("returning xforms");
>       return "http://www.w3.org/2002/xforms";;
>     } else if (prefix == 'ev') {
>       return "http://www.w3.org/2001/xml-events";;
>     } else {
>         throw new Error("Unknown namespace: " + prefix + ".");
>
> Now things work perfectly . I don't know why the nsFromMap is null even if
> I call the registerNameSpace
>
> Regards
> Hari
>
>
> On Sat, May 16, 2009 at 2:48 AM, Jian Fang <[email protected]>wrote:
>
>> I still cannot create and run a test case because I do not know any public
>> website
>> that uses XForm.
>>
>> Also, have you tried to use jQuery selector to see if you could select the
>> element correctly?
>>
>> Thanks,
>>
>> Jian
>>
>> On Fri, May 15, 2009 at 10:15 AM, Jian Fang <[email protected]>wrote:
>>
>>> It is invalid only in Selenium, right? For xml document processing, you
>>> have to add name space there.
>>>
>>> I will check where caused the problem in Selenium core.
>>>
>>> Thanks,
>>>
>>> Jian
>>>
>>>
>>> On Fri, May 15, 2009 at 10:10 AM, Harihara Vinayakaram <[email protected]
>>> > wrote:
>>>
>>>> Hi
>>>> I remember reading that in general an XPath with namespace (any
>>>> namespace) is treated as Invalid
>>>>   //xforms:lab...@id="message"]
>>>>
>>>> which is why a document.evaluate works for these types of expressions. I
>>>> have attached an example project which simulates the same
>>>>
>>>> Regards
>>>> Hari
>>>>
>>>>
>>>>
>>>> On Fri, May 15, 2009 at 6:20 PM, Jian Fang <[email protected]>wrote:
>>>>
>>>>> Would
>>>>>
>>>>> //descendant-or-self::xforms:lab...@id="message"]
>>>>>
>>>>> be a valid XPath in general?
>>>>>
>>>>> We can add a custom locate strategy for you, but the best way is to fix
>>>>> Selenium core itself
>>>>> if the XPath is valid in general. Could you provide us a test case so
>>>>> that I can dig into Selenium
>>>>> core to see what caused that problem?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Jian
>>>>>
>>>>>
>>>>> On Fri, May 15, 2009 at 8:44 AM, Harihara Vinayakaram <
>>>>> [email protected]> wrote:
>>>>>
>>>>>> Putting the namespace results in the following problem in Selenium
>>>>>>
>>>>>> Invalid xpath: //descendant-or-self::xforms:lab...@id="message"]
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> I had solved this problem in Selenium by using the Document.evaluate and 
>>>>>> using a separate locator
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> method . Not sure how I can  call the Document.evaluate in this case 
>>>>>> from Tellurium
>>>>>>
>>>>>> Regards
>>>>>> Hari
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Thu, May 14, 2009 at 10:30 PM, Jian Fang <[email protected]
>>>>>> > wrote:
>>>>>>
>>>>>>> Maybe later, we can refactor this so that you can register the
>>>>>>> namespace in defineUi, i.e., put into a queue,
>>>>>>> and let Tellurium Core handle the actual registration automatically.
>>>>>>>
>>>>>>> On Thu, May 14, 2009 at 12:58 PM, Jian Fang <
>>>>>>> [email protected]> wrote:
>>>>>>>
>>>>>>>> For example, in the @BeforeClass or @Before method after you start
>>>>>>>> the Selenium server.
>>>>>>>>
>>>>>>>> On Thu, May 14, 2009 at 12:57 PM, Jian Fang <
>>>>>>>> [email protected]> wrote:
>>>>>>>>
>>>>>>>>> No, should put in your test class because it will talk to Selenium
>>>>>>>>> server to add the name space, which is a runtime call.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Thu, May 14, 2009 at 12:50 PM, Harihara Vinayakaram <
>>>>>>>>> [email protected]> wrote:
>>>>>>>>>
>>>>>>>>>> Can I call the registerNameSpace in the defineUi ?
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Thu, May 14, 2009 at 10:02 PM, Jian Fang <
>>>>>>>>>> [email protected]> wrote:
>>>>>>>>>>
>>>>>>>>>>> I added registerNamespace method for you and you can try to
>>>>>>>>>>> register the namespace before you make calls
>>>>>>>>>>> to Selenium server. Namespace is enabled on UI objects, for
>>>>>>>>>>> example,
>>>>>>>>>>>
>>>>>>>>>>> ui.Container(uid: "TEST", namespace: "ns2", clocator: [:]){
>>>>>>>>>>>
>>>>>>>>>>> }
>>>>>>>>>>>
>>>>>>>>>>> Somewhere, you should call
>>>>>>>>>>> registerNamespace("ns2", "http://tellurium.org/ns";);
>>>>>>>>>>>
>>>>>>>>>>> you can do the same to add the namespace in and see if it works
>>>>>>>>>>> for you.
>>>>>>>>>>>
>>>>>>>>>>> Thanks,
>>>>>>>>>>>
>>>>>>>>>>> Jian
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On Thu, May 14, 2009 at 12:23 PM, Harihara Vinayakaram <
>>>>>>>>>>> [email protected]> wrote:
>>>>>>>>>>>
>>>>>>>>>>>> Hi
>>>>>>>>>>>>   I have one question regarding the usage of custom classes. Can
>>>>>>>>>>>> I directly use the XPath rather than defining an UI module  If so 
>>>>>>>>>>>> how do I
>>>>>>>>>>>> do that ? .The reason I am asking this is because I have elements 
>>>>>>>>>>>> that
>>>>>>>>>>>> belong to a different name space and the last time I remember I 
>>>>>>>>>>>> could not
>>>>>>>>>>>> define those elements in the Ui
>>>>>>>>>>>>
>>>>>>>>>>>>  Let me know
>>>>>>>>>>>>
>>>>>>>>>>>> Regards
>>>>>>>>>>>> Hari
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>
>> >>
>>
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Attachment: toJohn.tar.gz
Description: GNU Zip compressed data

Reply via email to