so, it seems that selenium does not like the [] around the attribute but xpather does. I tried the same same code but checked for the attribute 'name' and it worked, but 'disabled' does not work. the element DOES have the disabled attribute.
the html looks like this: <select disabled="disabled" name="secondary_group_by" onchange="disableExportButtons();"><option value="">------------ </option></select> ill try to put together a testcase On Jan 13, 12:34 pm, Mikhail Koryak <[email protected]> wrote: > Jian, > I tested this change and it is not working for me. The new xpath that > is generated cannot be found on page. > > What is interesting, is that if i change the xpath to: > //descendant-or-self::d...@id="filterSortBox"]/descendant-or- > self::sele...@name="secondary_group_by"]/self::node()[...@disabled] > (notice the square brackets around disabled) > this xpath evaluates correctly in xpather firefox plugin, but when i > made the change in the code selenium reports the following error: > > Command request: getAttribute[//descendant-or-self::div > [...@id="filterSortBox"]/descendant-or-self::select > [...@name="secondary_group_by"]/self::node()[...@disabled], ] on session > 364237 > 12:23:02.394 INFO - Got result: ERROR: Selenium failure. Please report > to the Selenium Users forum athttp://forums.openqa.org, with error > details from the log window. The error message is: The expression is > not a legal expression. on session 364237 > > also, isDisabled and isEnabled functions will need to be changed in > UiObject to use this fix. > Do you have any idea what can be wrong? > Ill poke around some more, if i cant figure it out ill make a testcase > to demonstrate the behavior > > On Jan 12, 9:59 am, [email protected] wrote: > > > Mikhail, > > > I think I have fixed the problem and please update your code from > > trunk/core to see if the fix > > works for you. > > > The problem comes from the Selenium attributeLocator format: > > loca...@attribute > > If you have already had an attribute in the locator, selenium will not > > be able to parse > > the "@attribute" portion correctly. > > > The fix is a trick one, instead of use > > > loca...@attribute > > > we can use > > > locator/self::node()@attribute > > > The "self::node()" portion refers to the current node itself and in > > this way, you will not > > have any attribute inside the last portion of xpath, i.e., self::node > > (). > > > Thanks, > > > Jian --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
