unable to use selenium via ASP.NET and C# -


i have read alot of answer on here question, not help, because try has not worked

i using selenium via asp.net c# on web app. want able login , webpage , parse page.

my problem continues cannot find binary(chrome or firefox). environment path contains location both. add binary path , still nothing. code have attempted below:

var ffbinary = new firefoxbinary(@"c:\program files\mozilla firefox\firefox.exe"); var firefoxprofile = new firefoxprofile(profilepath); var driver = new firefoxdriver(firefoxprofile); 

this tells me cannot find binary firefox, executable in location

var options = new openqa.selenium.chrome.chromeoptions(); options.binarylocation = "c:\\program files\\google\\chrome\\application\\chrome.exe";  var driver = new chromedriver(appdomain.currentdomain.basedirectory + @"\scripts", options, timespan.fromseconds(180));  

i mean looks fine, getting nowhere. can me conundrum?

here error: specified firefox binary location not exist or not real file: c:\program files\mozilla firefox\firefox.exe

here stack trace:

[webdriverexception: specified firefox binary location not exist or not real file: c:\program files\mozilla firefox\firefox.exe] openqa.selenium.firefox.internal.executable..ctor(string userspecifiedbinarypath) +229 openqa.selenium.firefox.firefoxbinary..ctor(string pathtofirefoxbinary) +87 addnewfantmplyrs.yahoofantm(string urllink, string unm, string pw) in h:\root\home\slickpk-001\www\site1\addnewfantmplyrs.aspx.cs:394 addnewfantmplyrs.loadtmbtn_click(object sender, eventargs e) in h:\root\home\slickpk-001\www\site1\addnewfantmplyrs.aspx.cs:194 system.web.ui.webcontrols.button.onclick(eventargs e) +9659822 system.web.ui.webcontrols.button.raisepostbackevent(string eventargument) +108 system.web.ui.webcontrols.button.system.web.ui.ipostbackeventhandler.raisepostbackevent(string eventargument) +12 system.web.ui.page.raisepostbackevent(ipostbackeventhandler sourcecontrol, string eventargument) +15 system.web.ui.page.raisepostbackevent(namevaluecollection postdata) +35 system.web.ui.page.processrequestmain(boolean includestagesbeforeasyncpoint, boolean includestagesafterasyncpoint) +1639

please try this...works on latest version of selenium 2.48.0 ff 41.0

firefoxprofilemanager profilemanager = new firefoxprofilemanager(); firefoxprofile firefoxprofile = profilemanager.getprofile("default"); // or custom created profile name firefoxbinary objbin = new firefoxbinary(@"c:\program files (x86)\mozilla firefox\firefox.exe"); // firefox installation directory  driver = new firefoxdriver(objbin, firefoxprofile); 

Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -