Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Jubula » Locator Parameter Correct Syntax(What is the correct syntax for the Locator parameter?)
Locator Parameter Correct Syntax [message #1726127] Wed, 09 March 2016 21:46 Go to next message
Drew Snader is currently offline Drew SnaderFriend
Messages: 7
Registered: February 2016
Junior Member
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 09:44 Go to previous message
Sebastian Struckmann is currently offline Sebastian StruckmannFriend
Messages: 18
Registered: October 2013
Junior Member
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
Previous Topic:SOLVED:Timeout received before confirming the posted event
Next Topic:Web Browser AUT Problem - Input Text and Replace Text Actions
Goto Forum:
  


Current Time: Sat Jul 27 10:32:14 GMT 2024

Powered by FUDForum. Page generated in 0.03023 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top