Finding dynamic ID in source and set that value to a variable

Skip to first unread message

Eric Hansen

Sep 25, 2013, 1:50:16 PM9/25/13
Hello Fakers!

Here's my scenario:

Objective: load a URL, enter values into a series of boxes, submit form, repeat

Challenge: the ID of the boxes is consistent except for a 3-digit prefix that changes for each page.

Example: on one page the element ID will be "123/rd:Year_of_Birth" and the next time it will be "456/rd:Year_of_Birth"

The "/rd:Year_of_Birth" part never changes, but I'm wondering how I can do some javascript to find that prefix and set it to a variable, then insert that variable into the workflow to target the correct boxes.

Thank you for a great app! I've told lots of coworkers about it and they've purchased too.


Clay Wilson

Jan 5, 2014, 2:35:48 PM1/5/14
Did you ever figure this out?  I'm trying to solve the same problem - click on a dynamically changed HTML link where only part of the link changes each time


Eric Hansen

Jan 6, 2014, 12:47:42 PM1/6/14
Yes, via javascript.

A coworker wrote some javascript that used the DOM to read in the source of the page, find the element with the name I was looking for, and store that element's dynamic prefix into a variable, which I then stored into a Fake variable and used it in the application as a "with ID" option.

E.g. ${ID}/input_element_name

I don't have the code anymore because I am no longer at that job. My apologies.

Mike Verdeyen

Feb 12, 2014, 4:36:09 PM2/12/14
well nuts.  Anyone out there have an example of anything close to this? (or examples of using javascript in fake?)  I'm trying to automate a flow that is filling out an auto-generated google form (the IDs change every time I run a I need to parse and can determine based on other attributes which values to put where, etc).  I can likely figure things out but could use a little jump start...if anyone has anything they can share, I would appreciate it very much.
Reply all
Reply to author
0 new messages