Click here to Skip to main content
15,896,473 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am facing issue that selenium chrome driver not opening from web application when deployed on IIS, although it is working fine locally. i also add console application within project and run same code via console application but browser not getting open.

What I have tried:

var options = new ChromeOptions();

options.AddArgument(@"--incognito");
options.AddArgument("start-maximized");




var driver = new ChromeDriver(options);
driver.Navigate().GoToUrl("http://202.61.43.40:8085/cfms-hc-search/web/index.php?r=cases%2Fsearch-result&CasesSearch%5BCASENAMECODE%5D=&CasesSearch%5BCASENO%5D=&CasesSearch%5BCASEYEAR%5D=&CasesSearch%5BCIRCUITCODE%5D=&CasesSearch%5BMATTERCODE%5D=&CasesSearch%5BPARTY%5D=&CasesSearch%5BGOVT_AGENCY_CODE%5D=&CasesSearch%5BFIRNO%5D=&CasesSearch%5BFIRYEAR%5D=&CasesSearch%5BPOLICESTATIONCODE%5D=&CasesSearch%5BADVOCATECODE%5D=&CasesSearch%5BisPending%5D=&CasesSearch%5BisPending%5D=3");
driver.Manage().Window.Maximize();


//





driver.FindElement(By.ClassName("select2-selection--single")).Click();
IWebElement txtSearch = driver.FindElement(By.ClassName("select2-search__field"));
txtSearch.SendKeys("Suit");
driver.FindElement(By.ClassName("select2-results__option--highlighted")).Click();



IWebElement caseno = driver.FindElement(By.Id("casessearch-caseno"));
caseno.SendKeys("22");





IWebElement year = driver.FindElement(By.Id("casessearch-caseyear"));
year.SendKeys("2017");





IWebElement ddlcourt = driver.FindElement(By.Id("casessearch-circuitcode"));
SelectElement select = new SelectElement(ddlcourt);
select.SelectByText("Karachi");



//Thread.Sleep(2000);
IWebElement search = driver.FindElement(By.ClassName("btn-success"));
search.Click();
Posted
Updated 18-Feb-20 23:02pm
v2
Comments
Richard MacCutchan 19-Feb-20 5:24am    
Are you sure it has been deployed correctly?
Noman Suleman 20-Feb-20 1:26am    
yes its deployed properly even its also not running on local IIS when i deployed on local machine its not running even with same code on Visual studio its running properly
F-ES Sitecore 19-Feb-20 10:08am    
Your code is running on the server so it is trying to open a window on the server, but you're not sat at the server, you are at your local machine, so you can't see it.

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