Thanks for reporting the slash problem. We will take a look to see if we
could solve it.

I doubted if escape could solve the @ symbol problem. Here is the code
snippet that
split the locator into locator and attribute name in selenium-browserbot.js.
The first section
for "uimcal=" is Tellurium logic and the second half is the original
Selenium code. We have
to change the logic here to infer when we do not need to look at the @
symbol.

BrowserBot.prototype.findAttribute = function(locator) {
    // Split into locator + attributeName
    var elementLocator = null;
    var attributeName = null;
    var attributePos = null;
    if (locator.startsWith("uimcal=")) {
        var cal = JSON.parse(locator.substring(7), null);
        !tellurium.logManager.isUseLog || fbLog("Parsed attribute locator",
cal);
        var loc = cal.locator;
        //get attribute name
        attributePos = loc.lastIndexOf("@");
        if (attributePos != -1) {
            attributeName = loc.slice(attributePos + 1);
            if (attributeName.endsWith("]")) {
                attributeName = attributeName.substr(0, attributeName.length
- 1);
            }
            !tellurium.logManager.isUseLog || fbLog("attribute name",
attributeName);
            //update locator
            cal.locator = loc.slice(0, attributePos);
            if (cal.locator.endsWith("[")) {
                cal.locator = cal.locator.substr(0, cal.locator.length - 1);
            }
        }

        elementLocator = "uimcal=" + JSON.stringify(cal);
        !tellurium.logManager.isUseLog || fbLog("Element Locator from the
findAttribute method", elementLocator);
    } else {
        attributePos = locator.lastIndexOf("@");
        elementLocator = locator.slice(0, attributePos);
        attributeName = locator.slice(attributePos + 1);
    }


On Tue, Apr 27, 2010 at 10:17 AM, Jonathan Share <[email protected]>wrote:

> On 8 April 2010 09:32, Jonathan Share <[email protected]> wrote:
> > On 7 April 2010 15:45, John <[email protected]> wrote:
> >
> > <snip/>
> >
> >>
> >> Would it be possible for you to use partial match? for example, have
> >> you tried to use "$PhoneNumber"
> >> as the name attribute?
> >>
> >
> > I can't use $PhoneNumber as I actually have two phone number fields
> >
> >            Container(uid: "phone") {
> >                Container(uid: "mobile") {
> >                    Selector(uid: "country", clocator: [name:
> > "Profile/Customer/Telephone/@CountryAccessCode"])
> >                    InputBox(uid: "number", clocator: [name:
> > "Profile/Customer/Telephone/@PhoneNumber"])
> >                }
> >                Container(uid: "home") {
> >                    Selector(uid: "country", clocator: [name:
> > "Profile/Customer/HomeTelephone/@CountryAccessCode"])
> >                    InputBox(uid: "number", clocator: [name:
> > "Profile/Customer/HomeTelephone/@PhoneNumber"])
> >                }
> >            }
> >
> > However if I try hard enough I can probably find a workaround for all
> > situations (trading off a little usability) but I don't really have
> > time to analyse all 26 occurrences of /@ in my code so for now I'll
> > stick to my disableCSSSelector() workaround and clean up if I have
> > some spare hours at the end of the project budget.
> >
>
> Hmmm, it seems that it's not only the @ causing problems but the
> slashes are also problematic.
>
> I have the following field in my markup;
>
> <input type="text" value="" tabindex="4" size="40"
> name="GroupDetail/Customer/PersonName/GivenName" class="firstName"/>
>
> That I have modelled as;
>
> InputBox(uid: "firstName", clocator: [name:
> "GroupDetail/Customer/PersonName/GivenName"])
>
> With this definition I get the following exception;
>
> com.thoughtworks.selenium.SeleniumException: ERROR: Element
>
> uimcal={"rid":"passengerInformation.firstName","locator":"jquery=#passengerInformation
> input[name=GroupDetail/Customer/PersonName/GivenName]"} not found
>
> Note how there's no quotes around the name specification even though
> all the examles in the jQuery documentation include them. If I update
> to specify the locator myself as follows;
>
> InputBox(uid: "firstName", locator: "
> input[name='GroupDetail/Customer/PersonName/GivenName']")
>
> Then I'm able to update the field, the only difference in the
> selectors is the '' around the text. I wonder if fixing this at the
> Tellurium level would also fix my problems with the usage of the @
> symbol.
>
> Regards,
>
> Jonathan
>
> --
> 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]<tellurium-users%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/tellurium-users?hl=en.
>
>

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

Reply via email to