'Navigate to tinyurl with appium driver doesn't work

As part of automation mobile testing I have to write tests which navigate to tinyUrl (using this api: https:// tinyurl.com/ api -create.php?url), and I'm facing this issue:

I'm getting an Appium Error in this code line: "driver.get(tinyUrl)

The error is:

Appium error: An unknown server-side error occurred while processing the command. Original error: Error attempting to start URI. Original error: Error: Starting: Intent { act=android.intent.action.VIEW dat=https://tinyurl.com/... pkg= }

Important points:

  1. "driver.get(tinyUrl)" works fine for general urls (not tinyurls)
  2. our automation code using BrowserStack with bs url of our mobile app.
  3. when run on app live Browserstack our app we can navigate to tiny urls in chrom search box, but when I run it through my code that integrate browserstack app- automate it throws the error I mentioned before.
  4. the string I send to driver.get() is correct and indicates a valid tiny url that was produced by this class implementation:
class TinyUrl {

    companion object {
        private const val tinyUrl = 'https://tinyurl.com/ api-create.php?url='
    }

    @Throws(IOException::class)
    fun shorter(url: String): String {
        val tinyUrlLookup = tinyUrl + url
        val reader =
            BufferedReader(InputStreamReader(URL(tinyUrlLookup).openStream()))
        return reader.readLine()
    }

Does Appium driver support navigating to tinyUrls? I didn't find much info about it. How can I solve this issue? What can be the cause for it?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source