storeassertXpath

description

Allows using the storeXpath, assertXpath and verifyXpath.
This allows to get an Xpath evaluation and to store it or to assert on it.

example of use

This will store the number of rows there is in the Person list

storeXpath count(//table[@id='Person-list']/tbody/tr) listCount

This will assert that the number of rows has been incremented by one (after an add for example)

assertXpath count(//table[@id='Person-list']/tbody/tr) javascript{parseInt(storedVars['listCount']) + 1}

notes

To use, simply copy the code in the user-extensions.js in your user-extensions.js

download

store assert xpath command v1_0
store assert xpath command v1_0_8_1

Labels

hi hi Delete
this this Delete
is is Delete
a a Delete
good good Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Mar 10, 2006

    François Eric says:

    I added a feature request in jira so that this can be added to the source code h...

    I added a feature request in jira so that this can be added to the source code http://jira.openqa.org/browse/SEL-194

  2. May 17, 2006

    David Kemp says:

    WARNING: If you are using the latest release (0.7), then you will need to replac...

    WARNING:
    If you are using the latest release (0.7), then you will need to replace isIE with browserVersion.isIE

    Also note that you should no longer need to include the code for storeXpath as it will automatically be supported due to the presense of the getter.

  3. Nov 27, 2006

    Dave Hunt says:

    This extension no longer works with 0.8.1 - any chance of a new version?

    This extension no longer works with 0.8.1 - any chance of a new version?

  4. Dec 07, 2006

    Tony Johnson says:

    +1
  5. Dec 13, 2006

    Sumith Gamage says:

    >> This extension no longer works with 0.8.1 - any chance of a new version...

    >> This extension no longer works with 0.8.1 - any chance of a new version?

    Hope store assert xpath command v1_0_8_1 will sortout this problem.

    P.S. All credit goes to the original author. Please note that the update is not approved by the original author yet.

    • Sumith
  6. Jan 31, 2007

    Dave Hunt says:

    Thanks for the update - this has got the extension working for Firefox again, bu...

    Thanks for the update - this has got the extension working for Firefox again, but IE is failing with the message 'Object expected'. On inspection I found that the extension uses function addXPathSupport, which is not included with Selenium Core 0.8 (it was previously found in html-xpath-patched.js). Perhaps there is an alternate function to use in 0.8? Anybody have any ideas?

  7. Jun 01, 2007

    konstantin.petkov says:

    Dave, I also hit that and searched for a solution. Unfortunately the xpath.js a...

    Dave,

    I also hit that and searched for a solution. Unfortunately the xpath.js available at \core\xpath\ contains quite different code. I'm afraid this extension is unusable on IE with the present version of Selenium Core.

    There is a topic on that here: http://forums.openqa.org/thread.jspa?messageID=24811&#24811

  8. Jul 04, 2007

    Dan Fabulich says:

    Am I right in thinking that all anyone really uses this for was counting element...

    Am I right in thinking that all anyone really uses this for was counting elements with the count() function? If so, I'm inclined to provide a more limited getXpathCount function that takes in an xpath and tells you how many elements match it. That helps simplify issues with the XPathResult types. See my remarks in http://jira.openqa.org/browse/SEL-194

  9. Jul 23, 2008

    anand says:

    Hi, I downloaded a given "store assert xpath command v1_0_8_1" file and stored i...

    Hi,
    I downloaded a given "store assert xpath command v1_0_8_1" file and stored it on the drive.
    Then,in Selenium IDE, I gave a path for user extension of IDE and restarted IDE.
    After restarting IDE it showed an error,
    "error loading Selenium IDE extensions: ReferenceError: Selenium is not defined".
    I am using Selenium IDE 1.0 Beta 2.
    Is there any solution for this?
    Thanks!

  10. Dec 30, 2008

    mbmiceli says:

    I am also getting this error  "error loading Selenium IDE extensions: Refe...

    I am also getting this error

     "error loading Selenium IDE extensions: ReferenceError: Selenium is not defined"

    was there a solution posted?