Click here to Skip to main content
15,893,508 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I use in my application, selenium web driver with phantomjs and firefox, for navigate url and get dom of html source and find elements.

for phantomjs, i use hidden firefox. and run in start program with one ip and port.
this is my code:

C#
ShellExecuteA((IntPtr) null, "open", FilePath + "\\phantomjs.exe", "--webdriver 127.0.0.1:8910",
                              null, 0);

                var siteBase = new Uri("http://localhost:8910/");

                var capabilities = new DesiredCapabilities {IsJavaScriptEnabled = true};
                Driver = new RemoteWebDriver(siteBase, capabilities);


then, navigate url with driver and get page source:
C#
Driver.Navigate().GoToUrl(url);
string html = Driver.PageSource;


so, my program runs very good in windows 7 64bit but, in windows server (2008, 2003) or windows in virtual box, don't run and finish without runing.

I use time out for load page or element, but i don't get any result.

Thank you.
Posted
Updated 28-Feb-15 19:32pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900