Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
674 views
in Technique[技术] by (71.8m points)

c# Selenium 2.53 moving to marionette driver after firefox upgrade to 47

I am trying to move into the upgraded firefox web browser automation using selenium. It seems that selenium needs marionette driver to continue working. I followed the instructions set by the devs,

  1. downloaded the driver
  2. renamed it to wires.exe

The following code didnt manage to properly set the PATH to a custom path.

System.Environment.SetEnvironmentVariable("webdriver.gecko.driver", "@C:DOWNLOADSwires.exe")

so i added wires.exe to the debugin folder and then wires.exe worked properly but i got the following error

System.InvalidOperationException was caught Message=entity not found Source=WebDriver

this is the code i use to start webdriver

FirefoxOptions option1 = new FirefoxOptions();
option1.IsMarionette = true;
option1.AddAdditionalCapability("marionette", true);
driver = new FirefoxDriver(option1);
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I too got the "Entity Not Found" error using FirefoxDriver(new FirefoxOptions()). It appears to be looking for firefox.exe in C:Program Files (x86)Nightly and not finding it. I found this working :

FirefoxDriverService service = FirefoxDriverService.CreateDefaultService();
service.FirefoxBinaryPath = @"C:Program Files (x86)Mozilla Firefoxfirefox.exe";
IWebDriver driver = new FirefoxDriver(service);

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...