Skip to content

Instantly share code, notes, and snippets.

@friendlyfreedom
Last active May 25, 2021 21:21
Show Gist options
  • Select an option

  • Save friendlyfreedom/122f056f48cec763c1d446880794abc8 to your computer and use it in GitHub Desktop.

Select an option

Save friendlyfreedom/122f056f48cec763c1d446880794abc8 to your computer and use it in GitHub Desktop.
How to use jQuery selector
*** Settings ***
Library SeleniumLibrary
*** Keywords ***
Show basic jQuery
[Documentation] '.classExample' gebruik je hetzelfde als je css:.classExample gebruikt,
... maar met jQuery kan je daar aan toevoegen de hoeveelste match, door dit uit te breiden
... met ':eq(hoeveelste voorkomen)'
... Dit voorbeeld is geselecteerd als 1, wat betekend het 2e voorkomen (eerste voorkomen is 0, zoals in python gebruikelijk)
Click Element jquery:.classExample:eq(1)
Show jQuery power in Loop
[Documentation] '.classExample' gebruik je hetzelfde als je css:.classExample gebruikt,
... maar met jQuery kan je daar aan toevoegen de hoeveelste match, door dit uit te breiden
... met ':eq(hoeveelste voorkomen)'
FOR ${index} IN RANGE 1 10
${source} Get text jquery:.classExample:eq(${index -1})
END
[return] ${source}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment