Azure Web App and WebDriver

830 views
Skip to first unread message

Martin

unread,
May 13, 2016, 12:09:25 PM5/13/16
to Selenium Users
Hi!

I am running a Web application on an Azure server, and I want to do some automation through Selenium and PhantomJS, but the problem is that Azure does not allow the use of localhost.
Does anyone have experience with this?

Cheers!

⇜Krishnan Mahadevan⇝

unread,
May 17, 2016, 11:06:52 PM5/17/16
to Selenium Users
Martin,

Since not many of us are familiar with the Azure cloud, you might want to add a bit more context to your question. What is the problem ? What is the error that you see. Maybe if you could please help add this, someone could help you out here.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/40fbb20f-80e8-4581-8729-e142606a430c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Martin

unread,
May 18, 2016, 4:20:43 AM5/18/16
to Selenium Users
Hello!

But of course, I'll post some more information. :)
Selenium is running in a web application, and this web application is published on an Azure web server, which means that it has restricted access to different things. E.g. Localhost.
When I initialize a new driver, (PhantomJS driver), I get this error:

OpenQA.Selenium.WebDriverException: Cannot start the driver service on http://localhost:50682/
   at OpenQA.Selenium.DriverService.Start()
   at OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute(Command commandToExecute)
   at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
   at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)

I was therefore wondering, if anyone have had the same experience and perhaps knew more about the issue that I do, because Azure and Selenium together can't be that rare. :)

Thanks,
Martin

⇜Krishnan Mahadevan⇝

unread,
May 18, 2016, 4:43:06 AM5/18/16
to Selenium Users
Martin,

A quick look at the command line args for phantomjs.exe [ the server binary ] revealed that it accepts a CLI named 
  --webdriver=<val>                    Starts in 'Remote WebDriver mode' (embedded GhostDriver): '[[<IP>:]<PORT>]' (default '127.0.0.1:8910')

So maybe you can set this CLI using the DesiredCapabilities [ The key for the capability would be com.visa.framework.ui.phantomjs.PhantomJSDriverService#PHANTOMJS_GHOSTDRIVER_CLI_ARGS ], wherein you pass the IP address of the actual machine and see if that helps.

Alternatively I stumbled into this blog post, which claims it can solve this restriction of "cannot access localhost on azure". Maybe you can give it a read and see if that helps 





Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

Martin

unread,
May 18, 2016, 5:13:08 AM5/18/16
to Selenium Users
Thank you very much, Krishnan. I will take a look right away. :)

rkau...@gmail.com

unread,
Apr 18, 2017, 5:16:03 PM4/18/17
to Selenium Users
I want to use phantomjs web driver on azue web job but its getting Exception;

OpenQA.Selenium.WebDriverException: Cannot start the driver service on http://localhost:51293/ at OpenQA.Selenium.DriverService.Start() at OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute(Command commandToExecute)

http://localhost:51293/ this path changed at every run .

For this issue I have tried multiple options but still getting exception on live (local it's working fine)

rkau...@gmail.com

unread,
Apr 18, 2017, 5:16:03 PM4/18/17
to Selenium Users
Hello Martin,

Have you got any solution for this I am getting same issue while usinh phantomjs webdriver on azure webjob

OpenQA.Selenium.WebDriverException: Cannot start the driver service on http://localhost:51293/ at OpenQA.Selenium.DriverService.Start() at OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute(Command commandToExecute)

http://localhost:51293/ this path changed at every run .

Please help 


On Wednesday, May 18, 2016 at 2:43:08 PM UTC+5:30, Martin wrote:

Diogo Nunes

unread,
Jan 8, 2018, 9:04:40 PM1/8/18
to Selenium Users
I have the same problem, with a headless Chrome(Driver).
Locally works fine, MacOS and Win10. On VSTS it doesn't.

And I'm not even trying to navigate to a page, that error displays as soon as I create an instance of ChromeDriver.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages