Skip to content

Instantly share code, notes, and snippets.

@leeuwe
Forked from friendlyfreedom/jQuery.robot
Created May 25, 2021 21:21
Show Gist options
  • Save leeuwe/50baeeead700982ca0ac4bd442702981 to your computer and use it in GitHub Desktop.
Save leeuwe/50baeeead700982ca0ac4bd442702981 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