Welcome to Our Site
| Name | Role | Department |
|---|---|---|
| Alice Smith | Engineer | Platform |
| Bob Jones | Designer | Product |
| Carol White | Manager | Operations |
| Dan Green | Analyst | Data |
| Eve Black | Developer | Mobile |
Written by RTILA X Engineering Team
Accept cookie consent banners conditionally
Complying with GDPR cookie prompts
| Name | Role | Department |
|---|---|---|
| Alice Smith | Engineer | Platform |
| Bob Jones | Designer | Product |
| Carol White | Manager | Operations |
| Dan Green | Analyst | Data |
| Eve Black | Developer | Mobile |
{
"name": "Accept_Cookie_Consent",
"settings": {
"urls": [
"https://learn.rtila.com/scenarios/conditional-logic/2"
]
},
"datasets": {
"content_rows": {
"item_selector": "css=.content-table tbody tr",
"properties": [
{
"name": "name",
"type": "text",
"selector": "css=td:nth-child(1)"
},
{
"name": "role",
"type": "text",
"selector": "css=td:nth-child(2)"
},
{
"name": "department",
"type": "text",
"selector": "css=td:nth-child(3)"
}
]
}
},
"commands": [
{
"command": "wait_for_selector",
"params": {
"selector": "css=#cookie-consent"
}
},
{
"command": "if",
"params": {
"condition": {
"type": "element_visible",
"selector": "css=#cookie-consent"
},
"then": [
{
"command": "click",
"params": {
"selector": "css=#accept-cookies"
}
},
{
"command": "wait",
"params": {
"timeout": 1000
}
}
],
"else": []
}
},
{
"command": "wait_for_selector",
"params": {
"selector": "css=.content-table"
}
},
{
"command": "extract_data",
"params": {
"dataset": "content_rows"
}
}
]
}
Cookie banners often block page interactions. This scenario uses an if guard to check whether the banner exists, click the accept button, and then extract the data from the now-visible table.
Copy the project JSON above, open RTILA X, create a new project, and paste it.
This scenario covers 2 RTILA X commands and is referenced in 2 learning articles.
Was this helpful?
Thank you for your feedback!