In Selenium IDE, how to get the value of the base url

后端 未结 7 1514
栀梦
栀梦 2021-02-04 01:19

Is it possible to retrieve the value of the base url from inside a Selenium script (a plain HTML-saved script from Selenium IDE)?

What I\'m trying to do

7条回答
  •  -上瘾入骨i
    2021-02-04 02:13

    You can also open your base page and use storeLocation to put the current location into a variable:

    |open|/||
    |storeLocation|host||
    |assertLocation|${host}somepage.html
    

    Bonus: here's how I figured out the corresponding SSL url

    |storeEval|window.document.location.toString().replace(new RegExp("^http://([^:]+):80"), "https://$1:40");|hostSSL|
    

提交回复
热议问题