GET SELENIUM URL



  • HI! Anyone here knows how to get the current url, from selenium into a variable?

    Using

    EXECUTEJS "var URL= window.location.href" -> VAR "URL"
    

    but that doesn't work like that xD



  • Also, <ADDRESS> says "Could not parse any data. The variable was not created."


  • Admin

    Can you show the error in the debgger log please



  • So, after having a nice little chat with @Ruri , it turns out that my webpage was redirecting later, which means that, by the time it updates <ADDRESS>, it was empty.
    A way to bypass this is adding a dummy EXECUTEJS, like

    EXECUTEJS "var hello = 'hello';"
    

    after a small delay, so it updates the <SOURCE> and <ADDRESS> variables and then, you can use your new <ADDRESS> variable, which returns the current URL.

    Thank you so much!


Log in to reply