I'm able to use:
let browserLog = await browser.manage().logs().get('browser');
console.log(util.inspect(browserLog))
in chrome but, does not work for IE and Edge browsers.
Any suggestions?
You cannot. The only browser and driver that currently provides the console log is Chrome w/ Chromedriver. It may be added to the W3C Webdriver spec at a later date, follow this issue https://github.com/w3c/webdriver/issues/406
Related
I disabled loading images in chrome while using webdriver with selenium now cant enable it.
I was using python to webscrape on instagram so thought it would be a good idea to disable images.
The commands i used:
options = webdriver.ChromeOptions()
options.add_argument("--disable-gpu=true")
options.add_argument("--blink-settings=imagesEnabled=false")
And now I cannot change it from chrome settings.
Screenshot of chrome settings page.
Please Help.
Edit: This happens only in my default Chrome Profile. Other Profiles work fine even though the profile I use for selenium is a different one.
After a long day on google finally found the solution.
options.add_experimental_option("prefs", {'profile.managed_default_content_settings.images': 1})
How do I launch a browser with all the user data(history, cookies & etc.) in python selenium web driver?
You can load existing browser profile while opening a selenium web driver. For Chrome see here, for FireFox see similar solutions
I have a situation here that we have a webGL dependent application to automate. i have automated the whole application on my laptop, and this application is running fine on chrome on my laptop. but the issue is when i run this application from a seperate machine which is a selenium GRID node. It gives me a message that the application required Webgl and and it ask me to enable the webGL. i have tried different methods like selenium option and ignoring the chrome black list as well.
when i open the browser manually and open the application it runs find and i checked on url chrome://gpu. it shows that the gpu is enaled.
but when i invoke the selenium and run the test cases,. the browser initiates with WebGl as disabled
i found the solution to this. here is the code you can use to enable WebGL for chrome.
DesiredCapabilities capability = DesiredCapabilities.chrome();
ChromeOptions options = new ChromeOptions();
**options.addArguments("--ignore-gpu-blacklist");**
capability.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
capability.setCapability("chrome.binary", "C:\\Temp\\chromedriver.exe");
capability.setVersion("9999");
capability.setCapability(ChromeOptions.CAPABILITY, options);
return new RemoteWebDriver(HUB_URL,capability);
I installed the selenium plugin in Firefox for automating a monitoring process. When i record the test case and rerun it it fails for pop up validation in the end. So i'm i'm confirming the monitoring as successful when i got a pop up at the end saying "successful". So i record the test case using selenium and when i rerun it at the end when its waiting for pop up to come two things are happening
the pop up in the record playback its not coming up.
the test case is failing for the pop up.
Please also suggest if i can use IE with selenium
Here You can check very good and easy example for how to handle javascript popup using selenum web driver : Selenium Webdriver for Javascript popup
To use IE with selenium web driver do following :
1 - Download IE driver of selenium web driver from HERE
2 - You can all IE driver from selenium web driver as per below :
System.setProperty("webdriver.ie.driver", "D:/IEDriver.exe");
InternetExplorerDriver IEDriver=new InternetExplorerDriver();
Note : In above code "D:/IEDriver.exe" is example path , you please set actual path where you have put your IE drivers.
I am trying to send keys to browser(not element) using this code:
Actions action = new Actions(driver);
action.sendKeys("Hello! World!");
action.perform();
It works well in Chrome and IE8, but get the result World in Firefox!
I am using Firefox 22 and Selenium WebDriver 2.32.0
Is it a bug? Thank you.
Firefox 22 will not be supported until Selenium 2.34.0 (It may work for some scenarios at the moment, but generally speaking it doesn't work).
I would suggest rolling back to FF20 if you want Selenium 2.32.0 to work, or FF21 if you want to upgrade to Selenium 2.33.0.