Skip to content

Instantly share code, notes, and snippets.

@123andy
Last active August 11, 2025 19:09
Show Gist options
  • Save 123andy/b25f47d943b2a3914d6de74ceddfe100 to your computer and use it in GitHub Desktop.
Save 123andy/b25f47d943b2a3914d6de74ceddfe100 to your computer and use it in GitHub Desktop.
Automating Stanford's New Project Survey (as of 2025-07-07)

Automating Stanford's New Project Survey

This assumes you are using Google Chrome browser.

It is a recording of the submission of the standard new project survey (as of 2025-07-07)

Setup

Follow the instructions here: https://www.perplexity.ai/search/0cd872cc-1556-4edb-82e0-803dabe4063e

  • enable DevTools
  • activate the Recorder (under 'More Tools' in the hamburger menu)
  • download the json file below and import it into your recorder

Use

  • Goto REDCap and create a new project
  • Fill out the name, purpose, and press 'Create Project'
  • When you see the following page with the 'I AGREE' button, pause!
    • image
  • Goto your Recorder and Play the script!
    • image

Have Fun!

{
"title": "Stanford New Project Script Starting at Next Page Button",
"steps": [
{
"type": "setViewport",
"width": 863,
"height": 763,
"deviceScaleFactor": 1,
"isMobile": false,
"hasTouch": false,
"isLandscape": false
},
{
"type": "click",
"target": "main",
"selectors": [
[
"aria/Next Page >>[role=\"button\"]",
"aria/[role=\"generic\"]"
],
[
"tr.surveysubmit span"
],
[
"xpath///*[@id=\"questiontable\"]/tbody/tr[6]/td/table/tbody/tr/td/button/span"
],
[
"pierce/tr.surveysubmit span"
],
[
"text/Next Page >>"
]
],
"offsetY": 2.59375,
"offsetX": 54.71875,
"frame": [
0
],
"assertedEvents": [
{
"type": "navigation"
}
]
},
{
"type": "click",
"target": "main",
"selectors": [
[
"aria/Every REDCap project starts in development mode and progresses through the REDCap Project Lifecycle. It is important to understand: New projects start in Development mode Development mode is NOT INTENDED for real data.  In general, if you care about the data in the project, it SHOULD NOT be in Development mode.  It is against RIT policy to host production data in a REDCap project that is in development mode. External modules do not incur any charges while a project is in development mode.  Feel free to experiment and try things out while working out your project details. You can preview what fees, if any, may apply in production through the External Modules tab of the R2P2 Dashboard button (blue button in lower-left corner).  Projects in development mode may contain additional banners (including surveys) to remind users not to enter production data when in development mode. Projects should always be in Production mode while real data is being collected. Moving to production mode requires administrative review.  Please allow 1-2 business days for the review to be completed.  However, if you must start data collection immediately, you can use this link for directions. While in production mode, some external modules incur monthly fees.  See the Redcap Maintenance Agreeement (RMA) information page for more details. All production REDCap projects must be registered and linked in R2P2.  You can link a REDCap project to R2P2 using the R2P2 Dashboard (blue button in lower-left corner) Once data collection is complete, a project should be moved to 'Analysis' mode and/or 'Completed' status. RMA fees are no longer charged once the project is in Analysis/Completed modes REDCap administrators may automatically transition projects to Completed status when they appear to no longer be active. Question required. I understand the REDCap Lifecycle and will move my project to Production Mode before entering 'real' data"
],
[
"td.col-11 > span span"
],
[
"xpath///*[@id=\"lifecycle_agreement-tr\"]/td[2]/span/div[2]/div/label/span"
],
[
"pierce/td.col-11 > span span"
]
],
"offsetY": 28.890625,
"offsetX": 355.5859375,
"frame": [
0
]
},
{
"type": "click",
"target": "main",
"selectors": [
[
"aria/Next Page >>",
"aria/[role=\"generic\"]"
],
[
"div.float-end span"
],
[
"xpath///*[@id=\"questiontable\"]/tbody/tr[3]/td/table/tbody/tr/td/div[2]/button/span"
],
[
"pierce/div.float-end span"
],
[
"text/Next Page >>"
]
],
"offsetY": 6.890625,
"offsetX": 64.71875,
"frame": [
0
],
"assertedEvents": [
{
"type": "navigation"
}
]
},
{
"type": "click",
"target": "main",
"selectors": [
[
"aria/All REDCap projects require an active user to be flagged as the Designated Contact. In the event the REDCap team needs to contact the project team, the designated contact will be used. Please make sure the Designated Contact is kept up-to-date with someone who is active and responsible for your REDCap project. This person must have User Rights to the REDCap project. Projects without a valid designated contact can be archived by the REDCap team at any time. Question required. I understand"
],
[
"#form span span"
],
[
"xpath///*[@id=\"dc_agreement-tr\"]/td[2]/span/div[2]/div/label/span"
],
[
"pierce/#form span span"
]
],
"offsetY": 21.890625,
"offsetX": 356.5859375,
"frame": [
0
]
},
{
"type": "click",
"target": "main",
"selectors": [
[
"aria/Next Page >>",
"aria/[role=\"generic\"]"
],
[
"div.float-end span"
],
[
"xpath///*[@id=\"questiontable\"]/tbody/tr[3]/td/table/tbody/tr/td/div[2]/button/span"
],
[
"pierce/div.float-end span"
],
[
"text/Next Page >>"
]
],
"offsetY": 10.890625,
"offsetX": 44.71875,
"frame": [
0
],
"assertedEvents": [
{
"type": "navigation"
}
]
},
{
"type": "click",
"target": "main",
"selectors": [
[
"aria/Will you store PHI in your project? Question required. No"
],
[
"#use_phi-tr span div:nth-of-type(2) span"
],
[
"xpath///*[@id=\"use_phi-tr\"]/td[2]/span/div[3]/div[2]/label/span"
],
[
"pierce/#use_phi-tr span div:nth-of-type(2) span"
]
],
"offsetY": 14.890625,
"offsetX": 333.5859375,
"frame": [
0
]
},
{
"type": "click",
"target": "main",
"selectors": [
[
"aria/Next Page >>",
"aria/[role=\"generic\"]"
],
[
"div.float-end span"
],
[
"xpath///*[@id=\"questiontable\"]/tbody/tr[4]/td/table/tbody/tr/td/div[2]/button/span"
],
[
"pierce/div.float-end span"
],
[
"text/Next Page >>"
]
],
"offsetY": 6.890625,
"offsetX": 59.71875,
"frame": [
0
],
"assertedEvents": [
{
"type": "navigation"
}
]
},
{
"type": "click",
"target": "main",
"selectors": [
[
"aria/We require all production REDCap projects to be registered and linked to R2P2 - the RIT Research Project Portal. You can link a REDCap project to R2P2 using the blue R2P2 Dashboard button in the lower-left corner on the REDCap project page.  Alternately, you can add existing REDCap projects to an R2P2 project through the R2P2 REDCap tab.  Linked REDCap projects with R2P2 provides additional capabilities. For example, you can request professional services, enable certain external modules, and share support inquiries with your collaborators. Have you already registered your research or QI project in R2P2? No"
],
[
"span div:nth-of-type(2) span"
],
[
"xpath///*[@id=\"r2p2_registered-tr\"]/td[2]/span/div[3]/div[2]/label/span"
],
[
"pierce/span div:nth-of-type(2) span"
]
],
"offsetY": 22.390625,
"offsetX": 346.5859375,
"frame": [
0
]
},
{
"type": "click",
"target": "main",
"selectors": [
[
"aria/Next Page >>",
"aria/[role=\"generic\"]"
],
[
"div.float-end span"
],
[
"xpath///*[@id=\"questiontable\"]/tbody/tr[5]/td/table/tbody/tr/td/div[2]/button/span"
],
[
"pierce/div.float-end span"
],
[
"text/Next Page >>"
]
],
"offsetY": 5.890625,
"offsetX": 64.71875,
"frame": [
0
],
"assertedEvents": [
{
"type": "navigation"
}
]
},
{
"type": "click",
"target": "main",
"selectors": [
[
"aria/The Research IT Team offers professional services to assist with project design, data importing, testing, and custom software development. We STRONGLY encourage research teams to leverage the experience and expertise of our team to maximize the functionality and efficiency of REDCap. Are you interested in learning more? No"
],
[
"#form div:nth-of-type(3) span"
],
[
"xpath///*[@id=\"request_prof_svcs-tr\"]/td[2]/span/div[4]/div[3]/label/span"
],
[
"pierce/#form div:nth-of-type(3) span"
]
],
"offsetY": 24.390625,
"offsetX": 349.5859375,
"frame": [
0
]
},
{
"type": "click",
"target": "main",
"selectors": [
[
"aria/Next Page >>",
"aria/[role=\"generic\"]"
],
[
"div.float-end span"
],
[
"xpath///*[@id=\"questiontable\"]/tbody/tr[4]/td/table/tbody/tr/td/div[2]/button/span"
],
[
"pierce/div.float-end span"
],
[
"text/Next Page >>"
]
],
"offsetY": 9.890625,
"offsetX": 64.71875,
"frame": [
0
],
"assertedEvents": [
{
"type": "navigation"
}
]
},
{
"type": "click",
"target": "main",
"selectors": [
[
"aria/Would you like to import Clinical Data into your REDCap project? No"
],
[
"span div:nth-of-type(2) span"
],
[
"xpath///*[@id=\"emr_data-tr\"]/td[2]/span/div[3]/div[2]/label/span"
],
[
"pierce/span div:nth-of-type(2) span"
]
],
"offsetY": 19.4453125,
"offsetX": 343.5859375,
"frame": [
0
]
},
{
"type": "click",
"target": "main",
"selectors": [
[
"aria/Next Page >>",
"aria/[role=\"generic\"]"
],
[
"div.float-end span"
],
[
"xpath///*[@id=\"questiontable\"]/tbody/tr[7]/td/table/tbody/tr/td/div[2]/button/span"
],
[
"pierce/div.float-end span"
],
[
"text/Next Page >>"
]
],
"offsetY": 10.9453125,
"offsetX": 34.71875,
"frame": [
0
],
"assertedEvents": [
{
"type": "navigation"
}
]
},
{
"type": "click",
"target": "main",
"selectors": [
[
"aria/REDCap supports electronic consents by creating a pdf file from a REDCap survey which can include a signature field, date field and name field. The generated pdf can be put into the REDCap project File Repository with the date/time that it was signed. The REDCap team has extended this capability by creating an External Module which can capture additional signatures to be merged with the participant survey before creating the pdf. For instance, if a research team signature is required for the consent to be valid, then a CRC can sign an additional form which can then be merged with the participant form. This extended capability can be added to your project. I will need to use electronic consent for my participants No"
],
[
"span div:nth-of-type(2) span"
],
[
"xpath///*[@id=\"electronic_consent-tr\"]/td[2]/span/div[3]/div[2]/label/span"
],
[
"pierce/span div:nth-of-type(2) span"
]
],
"offsetY": 16.390625,
"offsetX": 344.5859375,
"frame": [
0
]
},
{
"type": "click",
"target": "main",
"selectors": [
[
"aria/Next Page >>",
"aria/[role=\"generic\"]"
],
[
"div.float-end span"
],
[
"xpath///*[@id=\"questiontable\"]/tbody/tr[3]/td/table/tbody/tr/td/div[2]/button/span"
],
[
"pierce/div.float-end span"
],
[
"text/Next Page >>"
]
],
"offsetY": 9.890625,
"offsetX": 55.71875,
"frame": [
0
],
"assertedEvents": [
{
"type": "navigation",
"url": "https://realm.hearstnp.com/account/CheckC3P0Status?subjectId=f8fdf565-73d5-4fc1-8c16-6c71e0c4d543&message=hdn.js%20OTLryMQSacrEnl5nJ5fUPpl14YNC9ZDQ-pstjaJyqLI.27769667e72457e0f336a2f6e877b864&host=www.sfchronicle.com&bguid=94268ec3-1b90-4a91-976a-8c307c61abde",
"title": "REDCap"
}
]
},
{
"type": "click",
"target": "main",
"selectors": [
[
"aria/REDCap is extendable. There have been many enhancement modules created to extend the base functionality of REDCap. These modules can be used by any project that requires advanced capabilities. In addition, we can create custom modules to automate and support most REDCap-related tasks.  Request a consultation for more details. I would like External Modules enabled on my project. No"
],
[
"#em_needed-tr span div:nth-of-type(2) span"
],
[
"xpath///*[@id=\"em_needed-tr\"]/td[2]/span/div[3]/div[2]/label/span"
],
[
"pierce/#em_needed-tr span div:nth-of-type(2) span"
]
],
"offsetY": 14.390625,
"offsetX": 325.5859375,
"frame": [
0
]
},
{
"type": "click",
"target": "main",
"selectors": [
[
"aria/Next Page >>",
"aria/[role=\"generic\"]"
],
[
"div.float-end span"
],
[
"xpath///*[@id=\"questiontable\"]/tbody/tr[4]/td/table/tbody/tr/td/div[2]/button/span"
],
[
"pierce/div.float-end span"
],
[
"text/Next Page >>"
]
],
"offsetY": 16.890625,
"offsetX": 28.71875,
"frame": [
0
],
"assertedEvents": [
{
"type": "navigation"
}
]
},
{
"type": "click",
"target": "main",
"selectors": [
[
"aria/We are excited to announce the launch of a REDCap to OnCore connector. REDCap projects now have the ability to push and pull patient lists from OnCore. This new capability will eliminate duplicate entry of participants in each system and it can help keep the two systems synced. REDCap to OnCore Connector: Non-Cancer Studies Go-live date: November 1, 2022 For non-cancer studies, please see the Spectrum Information Page REDCap to OnCore Connector: Cancer Studies Projected go-live date: March 2023 For cancer studies, please see the Cancer Clinical Trials Office Information Page Will your project be linked to OnCore? No"
],
[
"#oncore_link-tr span div:nth-of-type(2) span"
],
[
"xpath///*[@id=\"oncore_link-tr\"]/td[2]/span/div[3]/div[2]/label/span"
],
[
"pierce/#oncore_link-tr span div:nth-of-type(2) span"
]
],
"offsetY": 12.390625,
"offsetX": 358.5859375,
"frame": [
0
]
},
{
"type": "click",
"target": "main",
"selectors": [
[
"aria/Next Page >>",
"aria/[role=\"generic\"]"
],
[
"div.float-end span"
],
[
"xpath///*[@id=\"questiontable\"]/tbody/tr[5]/td/table/tbody/tr/td/div[2]/button/span"
],
[
"pierce/div.float-end span"
],
[
"text/Next Page >>"
]
],
"offsetY": 9.890625,
"offsetX": 57.71875,
"frame": [
0
],
"assertedEvents": [
{
"type": "navigation"
}
]
},
{
"type": "click",
"target": "main",
"selectors": [
[
"aria/Twilio is a technology that allows communication with your participants via text messaging. REDCap surveys can be sent to participants via text, in addition to email. If you are interested in Twilio, please read the Twilio Information Page Will your project use Twilio to text your participants? No"
],
[
"span div:nth-of-type(2) span"
],
[
"xpath///*[@id=\"twilio_use-tr\"]/td[2]/span/div[3]/div[2]/label/span"
],
[
"pierce/span div:nth-of-type(2) span"
]
],
"offsetY": 11.390625,
"offsetX": 351.5859375,
"frame": [
0
]
},
{
"type": "click",
"target": "main",
"selectors": [
[
"aria/Next Page >>",
"aria/[role=\"generic\"]"
],
[
"div.float-end span"
],
[
"xpath///*[@id=\"questiontable\"]/tbody/tr[3]/td/table/tbody/tr/td/div[2]/button/span"
],
[
"pierce/div.float-end span"
],
[
"text/Next Page >>"
]
],
"offsetY": 12.890625,
"offsetX": 47.71875,
"frame": [
0
],
"assertedEvents": [
{
"type": "navigation"
}
]
},
{
"type": "click",
"target": "main",
"selectors": [
[
"aria/The REDCap team supports thousands of distinct users each month on hundreds of active production projects. In order to maximize our limited resources, we ask that BEFORE creating a support ticket, please try and find answers from the following resources (listed on the REDCap My Projects page). REDCap Help and FAQ REDCap Wiki If you are unable to find an answer, you can try scheduling an Office Hours Visit Lastly, you can create a Support Ticket from either the R2P2 Dashboard button on your REDCap project OR by visiting the R2P2 Portal And, once again, if you would like to schedule a consultation to discuss project planning and professional services, please register in R2P2 and create a new Consultation Request. Thank you! I understand"
],
[
"td.col-11 > span span"
],
[
"xpath///*[@id=\"support-tr\"]/td[2]/span/div[2]/div/label/span"
],
[
"pierce/td.col-11 > span span"
]
],
"offsetY": 8.390625,
"offsetX": 337.5859375,
"frame": [
0
]
},
{
"type": "click",
"target": "main",
"selectors": [
[
"aria/Next Page >>",
"aria/[role=\"generic\"]"
],
[
"div.float-end span"
],
[
"xpath///*[@id=\"questiontable\"]/tbody/tr[3]/td/table/tbody/tr/td/div[2]/button/span"
],
[
"pierce/div.float-end span"
],
[
"text/Next Page >>"
]
],
"offsetY": 10.890625,
"offsetX": 49.71875,
"frame": [
0
],
"assertedEvents": [
{
"type": "navigation"
}
]
},
{
"type": "click",
"target": "main",
"selectors": [
[
"aria/Did you find the information in this project creation survey useful? Not at all"
],
[
"div.enhancedchoice_wrapper > div:nth-of-type(1) span"
],
[
"xpath///*[@id=\"survey_useful-tr\"]/td[2]/span/div[4]/div[1]/label/span"
],
[
"pierce/div.enhancedchoice_wrapper > div:nth-of-type(1) span"
]
],
"offsetY": 17.390625,
"offsetX": 355.5859375,
"frame": [
0
]
},
{
"type": "click",
"target": "main",
"selectors": [
[
"aria/Submit",
"aria/[role=\"generic\"]"
],
[
"div.float-end span"
],
[
"xpath///*[@id=\"questiontable\"]/tbody/tr[5]/td/table/tbody/tr/td/div[2]/button/span"
],
[
"pierce/div.float-end span"
],
[
"text/Submit"
]
],
"offsetY": 10.890625,
"offsetX": 33.5078125,
"frame": [
0
],
"assertedEvents": [
{
"type": "navigation"
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment