WebPagetest Forums
Scripting dynamic DOM locators? - Printable Version

+- WebPagetest Forums (https://www.webpagetest.org/forums)
+-- Forum: WebPagetest (/forumdisplay.php?fid=7)
+--- Forum: General Discussion (/forumdisplay.php?fid=25)
+--- Thread: Scripting dynamic DOM locators? (/showthread.php?tid=13838)



Scripting dynamic DOM locators? - Lazmonster - 07-30-2015 10:38 PM

Hi I am trying to script a site that uses dynamic DOM identifiers (session based, of the type getElementById("yui_3_10_3_1_1438259156165_866") where the last 3 digits change.

I tried introducing a * wildcard, but no dice.

Any way of using CSS locators instead?

Advice welcomed.

ATB

Larry


RE: Scripting dynamic DOM locators? - pmeenan - 07-30-2015 10:46 PM

Your best bet is to use the exec(andwait) command and just use javascript to do whatever you want. It also makes it easier to debug because you can get it working locally in a dev tools console before trying remotely.