Skip to content

Instantly share code, notes, and snippets.

View friendlyfreedom's full-sized avatar

Elout friendlyfreedom

View GitHub Profile
$code = {
python -m pip install --upgrade pip
pip install robotframework
pip install robotframework-seleniumlibrary
pip install robotframework-faker
pip install robotframework-databaselibrary
pip install webdrivermanager
webdrivermanager -d "C:\Python36\Scripts" -l "C:\Python36\Scripts" chrome firefox
pip install robotframework-ride
}
@friendlyfreedom
friendlyfreedom / jQuery.robot
Last active May 25, 2021 21:21
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)
Check CSS from element
[Documentation] This keyword only works with xpath and is based on [https://developer.mozilla.org/en-US/docs/Web/API/Window/getComputedStyle|getComputedStyle]
... You can use this keyword as follows
... | Check CSS from Element | //path/to/element | style | Expected Value |
... | Check CSS from Element | //h2/div | font-size | 24px |
[Arguments] ${xpath} ${CheckStyle} ${ExpectedComputedStyle}
${ComputedStyle} Execute Javascript return document.defaultView.getComputedStyle(document.evaluate("${xpath}", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue,null)['${CheckStyle}']
Should Be Equal ${ComputedStyle} ${ExpectedComputedStyle}