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

467 views
Skip to first unread message

Eric Hansen

unread,
Sep 25, 2013, 1:50:16 PM9/25/13
to fak...@googlegroups.com
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.

Eric

Clay Wilson

unread,
Jan 5, 2014, 2:35:48 PM1/5/14
to fak...@googlegroups.com
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

Thanks!

Eric Hansen

unread,
Jan 6, 2014, 12:47:42 PM1/6/14
to fak...@googlegroups.com
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

unread,
Feb 12, 2014, 4:36:09 PM2/12/14
to fak...@googlegroups.com
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 test...so 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
Forward
0 new messages