As I've understood the vast amount of property checks in scLocators is built so changes to the source code don't destroy test cases.
I'm trying to write Selenium tests in WebDriver with the nightly SmartGWT 6.1d build from Sunday.
The following selector is generated during the test:
driver.clicks(ByScLocator.scLocator("//ListGrid[ID='FeverchartSearchIncludingAlternativesResultGrid']/body/row[medname=Marcoumar%20Tbl%203mg||1]"));
When the medname is something different than "Marcoumar..." the command fails with an ElementNotFound exception.
I've tested several selectors and found the following behaviour:
So as soon as the first property check in the square brackets fail it does not continue with the other property checks.
Our application is running on SmartGWT 4.1 with the build from 26th November 2015.
Edit: Even with the lastest version built on 3rd June 2016 the fallback methods have no effect.
One more thing I want to mention is that locators where multiple elements could be returned only return 1. findElements always returns either 0 or 1 elements, depending on whether an element has been found with the locator.
I'm trying to write Selenium tests in WebDriver with the nightly SmartGWT 6.1d build from Sunday.
The following selector is generated during the test:
driver.clicks(ByScLocator.scLocator("//ListGrid[ID='FeverchartSearchIncludingAlternativesResultGrid']/body/row[medname=Marcoumar%20Tbl%203mg||1]"));
When the medname is something different than "Marcoumar..." the command fails with an ElementNotFound exception.
I've tested several selectors and found the following behaviour:
Command | Result |
driver.findElements(ByScLocator.scLocator("//ListGrid[ID='FeverchartSearchIncludingAlternativesResultGrid']/body/row[medname=Marcoumar%20Tbl%203mg||1]")).size() | 1 |
driver.findElements(ByScLocator.scLocator("//ListGrid[ID='FeverchartSearchIncludingAlternativesResultGrid']/body/row")).size() | 0 |
driver.findElements(ByScLocator.scLocator("//ListGrid[ID='FeverchartSearchIncludingAlternativesResultGrid']/body/row[1]")).size() | 1 |
driver.findElements(ByScLocator.scLocator("//ListGrid[ID='FeverchartSearchIncludingAlternativesResultGrid']/body/row[medname=foo||1")).size() | 0 |
driver.findElements(ByScLocator.scLocator("//ListGrid[ID='FeverchartSearchIncludingAlternativesResultGrid']/body/row[medname111=foo||1")).size() | 0 |
Our application is running on SmartGWT 4.1 with the build from 26th November 2015.
Edit: Even with the lastest version built on 3rd June 2016 the fallback methods have no effect.
One more thing I want to mention is that locators where multiple elements could be returned only return 1. findElements always returns either 0 or 1 elements, depending on whether an element has been found with the locator.
Comment