Posts

Showing posts with the label override

Methods of easily debugging/fixing the scripts with known facts - Part1

Network proxy issue in the Firefox browser – we can handle the proxy issue in two ways a)        Fixing the issue outside the script – i.e., creating the Firefox Profile and set the proxy how we need and map it to the Selenium web driver script. By saying it looks easy. But the problem will start, Firefox profile Java class not able to get the correct intended Profile. This issue will happen if we have installed our Firefox browser outside the “c:/program files” folders. How we can resolve this issue? Yes, I do have workaround for this problem. We can achieve this by doing Method overriding. Here we need to override the method getPofiles of the class profileIni. Let see the code implementations, //Setting the firefox.exe file path File pathToBinary = new File (“<Firefox.exe file path>”); FirefoxBinary ffBinary = new FirefoxBinary(pathToBinary); //overriding the profilepath ProfilesIni profile = new ProfilesIni() { @Override public FirefoxProfile ge