When i am opening my same firefox profile through selenium webdriver, each time I have to activate shockwave player manually and changes are not getting saved in firefox profile.
Is there any way to activate plugins through script automatically or save changes in firefox profile for later use.
ProfilesIni profile = new ProfilesIni();
System.setProperty("webdriver.gecko.driver","C:\\Users\\Test-pc1\\geckodriver-v0.16.1-win64\\geckodriver.exe");
FirefoxProfile myprofile = profile.getProfile("SeleniumTest");
WebDriver driver = new FirefoxDriver(myprofile);
myprofile.setPreference("dom.ipc.plugins.enabled.Shockwaveflash.exe", "true");
I hope it will help you to achieve, what you want.
http://toolsqa.com/selenium-webdriver/custom-firefox-profile/ You can refer this.
Once you created your FF profile then, launch it and click on Option menu in right top corner,Select Options.
Select Application, And select the application and say savefile
Once you done, it then run you test with this profile.As mention in the link above.
Related
im having an issue when im running my robot tests.
The application under test (AUT) has a button that opens a new tab when you click it. It works on Chrome and IE when a user actually clicks that button. However, when i run my test to test that functionality in IE, the test opens a new window and that window is not being recognized (i used the SELECT WINDOW keyword in selenium2library)
Has anybody encountered this? is this an IE11 issue or IEWebDriver issue or something?
Here is my system specs:
OS - Windows 7
Browser - IE11
Robot Framework Version - 3.0.2
IEDriverServer version - 3.4
Thank you. i hope someone can help me.
When you run your test in IE the test opens a New Window instead of a new TAB is actually perfect.
As per #JimEvans on the github issue Selenium 3.7.1-IEDriverServer 3.7.0 : IEDriverServer opens a new Window instead of new TAB when JavascriptExecutor is used :
This is by design that a new window is opened.
I am creating some data and click on Save button. Manually when i do it there is no popup at all. But in automation browser of chrome i could see a popup appears asking to stay in page or leave page. How can i avoid the popup in automation script?
As per my knowledge, we have to create profile for chrome driver. I used the below whicc is not working for me. Can someone plssss plssss help me out on this
String userProfile= "C:\\Users\\user_name\\AppData\\Local\\Google\\Chrome\\User Data\\Default\\";
ChromeOptions options = new ChromeOptions();
options.addArguments("user-data-dir="+userProfile);
options.addArguments("--start-maximized");
WebDriver driver = new ChromeDriver(options);
driver.get("http://www.google.com");
is there any specific reason that you are using ChormeOptions?
You can simply use the below code, and it'll work fine and no popups.
System.setProperty("webdriver.chrome.driver","pathToChromeDriver");
WebDriver driver = new ChromeDriver();
driver.get("http://www.google.com");
I am new to selenium, I understand two ways to test download file
1) simply call web element click
2) taking download link and test whether file exist or not
my question is which is better way or is there any another method???
You have to be more specific about your question, but as far as Download functionality is concerned in a browser, you set a Browser Profile, so that it would download the files automatically in the desired location. you can use this code:
FirefoxProfile firefoxProfile = new FirefoxProfile();
firefoxProfile.setPreference("browser.download.folderList",2);
firefoxProfile.setPreference("browser.download.manager.showWhenStarting",false);
firefoxProfile.setPreference("browser.download.dir","c:\\downloads");
firefoxProfile.setPreference("browser.helperApps.neverAsk.saveToDisk","text/csv");
WebDriver driver = new FirefoxDriver(firefoxProfile);//new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), capability);
driver.navigate().to("http://www.yourpage.com/");
I trying to make a selenium script that checks a real estate website and emails any new properties. all of the old properties are stored in a databases, the listings are cross checked against the database and new ones are emailed.
I got it working pretty well, however I noticed that if I myself navigate to said real estate website manually I see 3-4 new listings. When I run the script through task manager and the driver opens the page through firefox, the driver does not see those newly listed properties! Why is this happening? Thanks
It is possible your browser is caching the outdated information.
Try calling:
driver.manage().deleteAllCookies();
After instantiating your driver, and before navigating to your page.
While using robot api's to drag and drop my mouse positions are being disturbed(running firefox in full screen mode) by an alert which asks "Allow to run silverlight?". Even my webdriver api's are getting affected due to this alert as the click intended to happen on one button performs on another.
I am using WebDriver to automate my scenario, combined with robot api for drag and drop. Is there a way i can set something in firefox profile so that this alert won't appear?
Below image shows the alert
https://drive.google.com/file/d/0B36CJTZFg52aUFhvWmZIVzNleEk/view?usp=sharing
On Windows you can do:
// Enable Silverlight
profile.setPreference("plugin.state.npctrl", 2);
And on OSX:
// Enable Silverlight
profile.setPreference("plugin.state.silverlight", 2);
On Windows, the DLL name is npctrl.dll, so I believe that's where the 'npctrl' comes from. You can see this from:
about:plugins
For Linux you will have to check. Open two tabs one for:
about:addons
And the other for:
about:config
In about:addons enable the Silverlight plugin to be Activated Always.
In about:config filter by 'plugins.state'. The item that changes when you change the activation state in about:addons is the one you add to add to the FireFox profile.
You can create new firefox profile
http://www.toolsqa.com/selenium-webdriver/custom-firefox-profile/
By opening firefox profile manager, and pressing add profile button and you can name it. Than you need to open that profile in FireFox, download Silverlight plugin, install it, and go to firefox plugins manager
https://helpdesk.contentraven.com/hc/en-us/articles/201455107-Mozilla-Firefox-and-Silverlight-Plug-In
in manager you will have to set silverlight plugin as Always Activate.
Then you have to just call this profile when you are invoking driver:
ProfilesIni profile = new ProfilesIni();
FirefoxProfile your_profile = profile.getProfile("<name of your profile>");
WebDriver driver = new FirefoxDriver(your_profile);