I guess the problem is that whenever you connect to a new page, the Seleniumbot got reloaded and thus, lost the namepsace you registered before. You can do a quick test to verify this, i.e., try to call the registerNamespace method right before your method call to selenium server.
The map is a preferred solution over the hardcoded the namespace. I can refactor the Map to be global so that the information hold there will not be lost even page is refreshed or reloaded. Thanks, Jian On Sat, May 16, 2009 at 8:11 AM, 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 -~----------~----~----~----~------~----~------~--~---
