I use AppiumLibrary with RobotFramework to test web browsing on Android. In several of the test, I need to find out what is the current URL that the user has been directed to after clicking on a link.
The basic sample test case is:
Test Appium
AppiumLibrary.Open Application http://localhost:4723/wd/hub platformName=Android platformVersion=6.0.1 deviceName=0815f853b6d22c05 browserName=default
AppiumLibrary.Go To Url https://www.amazon.com/
sleep 5s
${current_url} get current url
log to console ${current_url}
Unlike SeleniumLibrary, AppiumLibrary does not have a keywork to do this, so I have to create my own keyword for get current url in python. I have tried several things looking at the AppiumLibrary source code and also the Appium-Python-Client module that implements the Appium Webdriver for python. But I have not found how to get the current url that chrome is showing to the user. Any hints on where I should look to find a solution?