How to get the current URL in Robot framework?
robotframework, selenium-webdriver
Solution
Try this:
${url}= Get Location
Problem
When the 'apply' link is clicked, it opens a new browser in Robot framework. How to get current url of that page? Here is the code: ``` Open Server Set Browser Implicit Wait 60 Go To ${server}/jobs Element Should Be Visible xpath=.//*[@id='txtjobsearch'] Input Text xpath=.//*[@id='txtjobsearch'] ${job Title search} Element Should Contain xpath=(.//*[@class='clearfix tit-job']/div)[1] ${Job title} Element Should Be Visible xpath=(.//*[@class='btn btn-sm btn-primary btnApply'])[1] Click Element xpath=(.//*[@class='btn btn-sm btn-primary btnApply'])[1] ``` After this line, it opens a new window. How to get url of newly opened page and do actions like input text? ``` Set Browser Implicit Wait 20 Wait Until Page Contains Element xpath=.//*[@class='text-primary'] ```