kazurayam
Katalon Evangelist
04/02/2018

Katalon Studio behind Proxy is unable to open browser on BrowserStack

## OS : Windows 7  

## Katalon Studio Version : 5.3.1

## Katalon Studio logs: 

Windows (<Katalon Studio folder>\config\.metadata\.log) is attached

## Environment (for Web testing)

Browser : Remote  (Windows 10, Chrome 62.0) on BrowserStack

## Environment (for Mobile testing)

N/A

## Steps to reproduce -

1) I created my Browser Stack account, got Username and Access Key.

2) My PC at work is located behind HTTP Proxy, so I set Proxy for Katalon Studio. see the attached image: 

3) In my Katalon project, I added definition of a Remote browser using my BrowserStack credential. See the attached image: 

## Actual Behavior -

When I ran my Test Suite with Remote browser, I got a FAILURE:
Unable to open browser with url: '' (Root cause: 
org.openqa.selenium.remote.UnreachableBrowserException:
Could not start a new session. Possible cause are invalid 
address of the remote server or browser start-up failure.

## Expected Behavior -

I run the same test project on the same PC using local FireFox browser, it ran SUCCESS.

I tried to run the same project on another PC which is NOT behind the Proxy. The test ran SUCCESS. See the attached: 
I changed my Proxy setting from "Manual Proxy Configuration" to "Use system proxy configuration" and tried. I got the same result.

## I think

As Browserstack's documentation ["Running tests from behind a proxy"](https://www.browserstack.com/automate/java) sais, I think Katalon Studio behind Proxy seeds to do this:
System.getProperties().put("http.proxyHost", "<HOST>");
System.getProperties().put("http.proxyPort", "<PORT>");
But Katalon Studio seems not doing this. 

I would request Katalon Team to look as this problem.

---------------------------------------------------------------------------------

In my job we are interested in testing on multi-versions of browsers. The combination of Katalon Studio and Browserstack looks promising for me. But our companies policy requires us stay behind Proxy. Therefore I strongly require the above problem to be fixed a.s.a.p. 

## Screenshots / Videos

see above.

Upvote
Quote

Comments

  • Vinh Nguyen
    Katalon Moderator
    04/03/2018
    Is your web application a local / staging or just a production server?
    Upvote
    Quote
  • kazurayam
    Katalon Evangelist
    04/03/2018
    I am looking at our production server exposed to the Internet. BrowserStack should be able to get access to it directly without intervening proxy etc. 

    Let me draft the configuration:

    My PC --> Http Proxy --> BrowserStack --> Our production Web App
    Upvote
    Quote
  • kazurayam
    Katalon Evangelist
    04/04/2018

    https://stackoverflow.com/questions/34846014/using-selenium-remotewebdriver-behind-corporate-proxy

    This post in the Stackoverflow seems desribing how a Java App (Katalon Studio) can connect to a selenium grid such as BrowserStack via RemoteWebDriver from behind a corporate proxy.
    Upvote
    Quote
  • kazurayam
    Katalon Evangelist
    04/08/2018
    I have been struggling with this issue. I want to it clear if I could make any workaround for myself. I have studied the code described by the StackOverflow 34846014 post I mentioned above, and understood the mechanism of org.openqa.selenium.remote.RemoteWebDriver class.

    Now I want to ask a question to someone (Katalon Team, of course) who has immediate access to the Katalon Studio source code. I would be grateful if you reply to my question; I am aware that Katalon Studio is not an OSS product.

    I believe that Katalon Studio calls org.openqa.selenium.remote.RemoteWebDriver object to communicate with "Remote" browser. According to the API document, it has 5 signatures of constructor:
    1. public RemoteWebDriver(Capabilities desiredCapability)
    2. public RemoteWebDriver(CommandExecutor executor, Capabilities desiredCapabilities)
    3. public RemoteWebDriver(CommandExecutor executor, Capabilities desiredCapabilities, Capabilities requiredCapabilities)
    4. public RemoteWebDriver(URL remoteAddress, Capabilities desiredCapabilities)
    5. public RemoteWebDriver(URL remoteAddress, Capabilities desiredCapabilities, Capabilities requiredCapabilities)
    Which signature of constructor is Katalon Studio ver5.3.1 invoking in order to instantiate a RemoteWebDriver? ... I guess it uses #4. Am I right?
    Upvote
    Quote
  • kazurayam
    Katalon Evangelist
    05/18/2018
    edited May 19
    This issue is still outstanding for me. I haven't got any favorable solution yet.

    My PC sits behind the cooperate proxy. When I run my test case selecting Remote Browser directed to the Browserstack URL, the Katalon Studio fails to find the hostname of URL of Browserstack. The message indicates that Katalon Studio tried to make a HTTP request to the URL WITHOUT setting proxy information.

    The following figure shows what I guess.



    (1) On my PC when I run a test selecting local Firefox browser, Katalon App calls Selenium server to talk to Firefox. The Katalon App informs Firefox browser of the Cooperate Proxy's address and port.

    (2) Firefox browser starts HTTP session to the Target Web App through the Cooperate Proxy. The session successfully goes through the Proxy. Test case runs.

    (3) If I do NOT have a Proxy, Katalon app can call the Selenium server running on the remote server (Zalenium or Browserstack). I have ever tried it and got success.

    (4) On the remote server (Zalenium or Browserstack) the Selenium server process runs. The Selenium server accepts HTTP request from my Katalon studio for activating remote browser. 

    (5) On the contrary, if I sit behind the cooperate proxy, the Katalon app fails to communicate with the remote Selenium server. Why? ---- Katalon Team has explained very little. All they said is "Remote Browser is not supported". I would rephrase this: "Katalon Studio does not support communicating with Remote Selenium server over Proxy".

    Let me tell you what I presume. Katalon app is coded with assumption that it can communicate with the Selenium server without Proxy in between. 

    This naive assumption holds true in the case of (1) where the Selenium server is running locally on my PC. However it does not necessarily true in the case of (3) and (5) where the Selenium server is running on a remote server. There may be or may not be a proxy. If there isn't =(3), you would be happy. If there is =(5), you would be annoyed.

    Even if I have set the Proxy address and port at the menu Window>Katalon Studio Preferences>Katalon>Proxy, the Katalon app does not use it for communicating with the Selenium server.

    Why the Katalon app does not (yet) support Proxy in between the local PC and the remote Selenium servers? --- I don't know. Ask Katalon.

    ----------------------------------------------------------------------------------------------------------------------------

    My advise to Katalon users behind proxy who want to use Zalenium/Browserstack

    Get out of your cooperate proxy barrier. Go home, or run Katalon Studio on AWS EC2, or find a new job without proxy annoyance. 

    ----------------------------------------------------------------------------------------------------------------------------

    Additional discussion.

    A few people behind cooperate proxy want to use remote Selenium Grid (Zalenium, Browserstack). They are discussing how to set proxy information.
    I am afraid that their efforts would not be successful. Because the DesiredCapabilities set to the remote browser (see (6) in the above figure) has nothing to do with the communication between the Katalon Studio app and the remote Selenium server (see (5) in the above figure).
    Upvote
    Quote
  • Vinh Nguyen
    Katalon Moderator
    05/18/2018
    We've added a ticket for it. It will be considered for efforts to fix it in later releases.

    Regards
    Upvote
    Quote
  • Hari
    Katalon Ambassador
    07/03/2018
    Hi - Any updates on this issue. I just met this issue in our project. Could you please update whats happening with this. it seems to be this is blocker whoever using Katalon in automating behind the proxy. 
    Upvote
    Quote
  • kazurayam
    Katalon Evangelist
    07/04/2018
    No resolution done yet.

    Just an idea how to workaround:
    https://forum.katalon.com/discussion/6248/setup-proxy-manually#latest

    Upvote
    Quote
  • Hari
    Katalon Ambassador
    07/12/2018
    We've added a ticket for it. It will be considered for efforts to fix it in later releases.

    Regards
    Hi Vinh,

    Any update on this? In which Katalon release this will be fixed?
    To be honest with you, this is very much required in our organization as we have huge cross-browser testing requirements. also, this fix will be more useful for other people as well. Pushing this ticket to next release will be a great help. 

    Thanks
    Upvote
    Quote
  • Neelesh Singh
    Katalon Apprentice
    09/14/2018
    We've added a ticket for it. It will be considered for efforts to fix it in later releases.



    Any updates??
    Upvote
    Quote
  • Neelesh Singh
    Katalon Apprentice
    09/14/2018
    Any updates on this ticket??...it quite blocking!
    Upvote
    Quote
Sign In or Register to comment.