Selenium IDE often uses Xpath in a "click".
For example:
Selenium's ClickAndWait //div[@id='block-system-main']/div/table/tbody/tr[3]/td[3]/a
becomes PHPUnit's
$this->click("//div[@id='block-system-main']/div/table/tbody/tr[3]/td[3]/a");
unfortunately, the conversion in simpletest_selenium becomes the invalid
$this->drupalPost(NULL, $edit, t('//div[@id='block-system-main']/div/table/tbody/tr[3]/td[3]/a'));
Comments
Comment #1
rfayIt looks like Drupal simpletest doesn't have the capability that Selenium/phpUnit seem to - clicking on a link by xpath. All we have is clickLink, which does it by label.
Since selenium does this a *lot*, we should probably wrap this one up.
Comment #2
boombatower commentedThis is an interesting issue, short of adding clickLinkXpath() which is probably a good idea, but annoying since we won't be able to get it in D7 although we will probably end up standardizing contrib on 7.x-2.x.
We can find link using xpath and then pass label to clickLink, but since we don't know the offset it is a bit harder. I bet with a bit of hacking in SimpleXML we can get this to work as is just not sure we want to.