Search code examples
javascriptseleniumhrefselenium-ide

selenium - javascript - how to open a different url?


I've got the_id to be 31

How can I go to that url with js in selenium?

I have been trying:

store # not sure command to use here.  Not "open" as that open up this window.
javascript{window.location.href = "/districts/${the_id}"}    
dummy

but ${the_id} is not being interpolated.


Solution

  • It turned out that it actually was being interpolated OK

    It was just the log showed the ${the_id} but the url used the real value.

    It was hard to see as I am testing error pages which make the actual url hard to see.