Locator Parameter Correct Syntax [message #1726127] |
Wed, 09 March 2016 16:46  |
Eclipse User |
|
|
|
The Jubula Reference Manual documentation for (5.4.1.1) Click Locator, (5.4.2.4) Check Text by Locator, and (5.4.3.1) Wait for component (based on locator) says to use "css=..." for a CSS locator and "xpath=..." for an XPath locator.
I have found that both of the following example Locator parameter values seem to work equally well when using the above toolkit actions.
'xpath=//*[@id="topbar"]/div/a[6]'
'//*[@id="topbar"]/div/a[6]'
Is "xpath=" (or "css=") really needed when setting the LOCATOR parameter for the Click, Check Text, and Wait actions or is it merely an optional, self-documenting code formality?
|
|
|
Re: Locator Parameter Correct Syntax [message #1726633 is a reply to message #1726127] |
Tue, 15 March 2016 05:44  |
Eclipse User |
|
|
|
Hello Drew,
both your examples work equally, because (as far as I know) they are the same in Selenium. Jubula simply delegates these locator to Selenium which evaluates them. If you don't specify the type of the locator, the xpath is chosen by default. If you want to use css locators, you have to specify that. Some pros and cons of both types are explained here.
Best regards,
Sebastian
|
|
|
Powered by
FUDForum. Page generated in 0.04769 seconds