Sorry for the horrible formatting...i still did not figure out how to format nicely..
I am trying to launch firefox using Selenium. Firefox is installed in AppData folder. Hence I tried to set the Binary path on the Desired Capability object using the below code
System.setProperty("webdriver.gecko.driver","C:\\path\\geckodriver.exe");
String pathToBinary = "C:\\Users\\me\\AppData\\Local\\Microsoft\\AppV\\Client\\Integration\\D90C0155-81ED-4977-B52D-E34EAA24FB3C\\Root\\VFS\\ProgramFilesX86\\Mozilla Firefox\\firefox.exe";
ProfilesIni profile = new ProfilesIni();
FirefoxProfile testProfile = new FirefoxProfile();
testProfile.setAcceptUntrustedCertificates(true);
testProfile.setAssumeUntrustedCertificateIssuer(true);
DesiredCapabilities dc = DesiredCapabilities.firefox();
dc.setCapability(FirefoxDriver.PROFILE, testProfile);
dc.setCapability(FirefoxDriver.BINARY, pathToBinary);
driver = new FirefoxDriver(dc);
driver.manage().deleteAllCookies();
driver.manage().window().maximize();
//driver.manage().window().setSize(new Dimension(1920, 1080));
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
driver.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS);
System.out.println("beforee driver.get");
driver.get("https://www.google.co.za");
I am having 2 issues here..
1. Getting below error on - driver.manage().window().maximize();
org.openqa.selenium.WebDriverException: Failed to find width field
Build info: version: '3.5.3', revision: 'a88d25fe6b', time: '2017-08-29T12:54:15.039Z'
System info: host: 'N0610114502', ip: '10.9.21.178', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
2. If I comment out that line and run the program, i get the below error
org.openqa.selenium.InvalidArgumentException:
Build info: version: '3.5.3', revision: 'a88d25fe6b', time: '2017-08-29T12:54:15.039Z'
System info: host: 'N0610114502', ip: '10.9.21.178', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{moz:profile=C:\Users\cc305718\AppData\Local\Temp\rust_mozprofile.sIobxPYVJ8iA, rotatable=false, timeouts={implicit=0, page load=300000, script=30000}, pageLoadStrategy=normal, platform=XP, specificationLevel=0, moz:accessibilityChecks=false, acceptInsecureCerts=true, browserVersion=52.5.0, platformVersion=6.1, moz:processID=6712, browserName=firefox, javascriptEnabled=true, platformName=XP}]
Session ID: 030d91eb-9219-43c9-9ade-210005b150b8
Does this mean I am setting the Binary in a wrong way? If so what is the correct usage?
I am not keen to use the below depricated method
FirefoxProfile profile = new FirefoxProfile();
FirefoxBinary binary = new FirefoxBinary(new File("C:\\path to firefox\\firefox.exe"));
driver = new FirefoxDriver(binary, profile);