I'm trying to turn of the Firefox native events on Linux. I tried to set the following in my protractor.conf.js file:
capabilities: {
browserName: 'firefox'
nativeEvents: true
}
.....
But it doesn't seem to work at all. This capability looks like a correct one because if I substitute its value to 'true' instead of true, the underlying WebDriver throws ClassCastExceptio: cannot cast String to Boolean.
I also tried to manually create the firefox profile (as described here) but still no luck.
Idea how to enable the native events in Firefox on Linux?
Related
I have some code like this:
if (navigator.share) {
navigator.share({
title: 'example',
url: 'http://example.com',
});
}
According to this documentation for navigator.share on MDN, desktop browsers do not support the Web Share API, and navigator.share is undefined in those browsers.
However, when I run this code in desktop Firefox, navigator.share is defined and set to a function that doesn't seem to do anything when called.
It probably is a browser extension that is setting navigator.share. Try disabling all your extensions.
In my case, it turned out to be this extension: Plasma Integration by KDE.
I'm automating a website and sometimes it uses an ip address as url, that ip address generates a connection is not secure message in Firefox. Researching online I found out that for Firefox, the default in chimp is acceptInsecureCerts = False. That doesn't happen to Chrome as the default is acceptInsecureCerts = True.
How can I change that in Chimp to make it also work in Firefox? Do I need to create a profile? If so, how can I do that? Thanks!
This is more of a WebdriverIO config than Chimp. See here how you can set acceptInsecureCerts using the desiredCapabilities section of the config like this:
module.exports {
webdriverio: {
desiredCapabilities: {
browserName": "firefox",
acceptInsecureCerts": true
}
}
}
The config above goes in the Chimp config file. See here for details
See the full Chimp config here
See the Webdriver.io config here
See the desiredCapbilities support for webdriver here
Note that browsers have their own extra desiredCapabilities, like Chrome for example.
So I'm a relatively new Appium user, so please excuse me if this question seems a little basic.
My company has a hybrid application which uses webiews in several places, and I am currently in the middle of writing test scripts for this application in Ruby using Appium. I've been stuck for a while, because I reach a page where I need to search for elements inside a webview and click on them. So far, I've managed to switch contexts to the webview using
set_context context_array.last
and I know that the context switch is successful, because I then output my current context to the terminal, and it correctly outputs that I'm in the webview. I then used Safari to inspect the elements in my webview, and saw the following HTML code:
HTML Source Code Excerpt
I followed the xlink and found the following lines of code:
<symbol id="icon-eat" viewBox="0 0 58 58">
<title>icon-eat</title>
So in my Appium script, I've tried to locate the element using the following, which so far haven't worked.
1. wait { xpath('//symbol[#id="icon-eat"]') }
2. wait { id("icon-eat") }
Any advice on how to proceed? My capabilities are:
options = {
caps: {
platformName: 'iOS',
platformVersion: '10.3',
deviceName: 'iPhone 7',
app: APP_PATH,
automationName: "XCUITest",
browserName: "iOS",
startIWDP: true,
nativeWebTap: true
},
launchTimeout: 20000
}
An Appium log is attached. I've replaced the company name and other sensitive details for security purposes.
https://drive.google.com/file/d/0B6mwi0KrKYGQTGctek9wWm5ES28/view?usp=sharing
I want to run tests with Firefox/protractor with the cache feature disabled.
(Actually, I'm trying to prevent 304 HTTP responses).
There are multiple ways to do this:
Disable the cache from the backend-side by droping Etag headers -> I can't modify the backend
Drop the Etag header from the frontend-side -> I tried, it did not work
Disable the cache from firefox: I just have to set the flag network.http.use-cache to false
Manually it works. I receive only 200 responses and it's great.
I want to be able to set this flag through protractor configuration. After some search I found out that I had to create a custom profile and set it in protractor this way (https://code.google.com/p/selenium/wiki/DesiredCapabilities):
capabilities: {
browserName: 'firefox',
firefox_profile: 'support/firefox_profile'
}
The problem is that the firefox profile is not considered. Is it the right option?
Do you have a better idea?
Thanks for your help.
EDIT:
As someone (suggested
capabilities: {
prefs: {
'config.http.use-cache': false
}
}
It did not work - I checked in about:config, the flag was still enabled.
How do you know what options you can pass in the capabilities?
Here's an example of how to integrate firefox-profile with protractor: https://github.com/juliemr/protractor-demo/tree/master/howtos/setFirefoxProfile
EDIT: For those upgrading to protractor >=1.6, the old way of doing this was broken because 'browser' can no longer return a promise. The demo has been updated.
My Selenium tests use onMouseOver features like
List<WebElement> menuitems = getDriver().findElements(By.tagName("li"));
Actions builder = new Actions(getDriver());
WebElement menu = menuitems.get(2);
getDriver().manage().timeouts().implicitlyWait(Constants.IMPLICITY_WAIT, TimeUnit.SECONDS);
builder.moveToElement(menu).build().perform();
I'm using Firefox driver. Since Firefox updated itself to version 18, my tests stopped working. I know this has to do with native events support - but does not version 18 support native events, or am i able to enable them? If not, is there any replacing implementation to my code?
I'm using selenium java 2.28.0.
For Firefox 18 support we need use selenium webdriver api 2.28.0,jar.
Selenium Java 2.27 mentions that native support for FF17 has been added. However, there has been no mention of support for FF18 in the change logs for 2.28. So its webdriver not supporting native events and not FF18 not supporting native events. You can try downgrading to FF 17 and probably turn off automatic updates for some time.
Rolling back to FF17 is a temporary work around until WebDriver version supports FF18
FF17 Extended Support Release packages -- http://www.mozilla.org/en-US/firefox/organizations/all.html
Note: If you are Mac user, you can simply rename your current FF from 'FireFox' to 'FireFox18' in your applications folder. Install the package from the above URL, which should create a new application called 'FireFox' that will be used by WebDriver.
My hover-over broke with v28. I now use the following hoverOver method with an optional javascript workaround and it seems to work okay.
public void HoverOver(IWebElement elem, bool javascriptWorkaround = true)
{
if (javascriptWorkaround)
{
String code = "var fireOnThis = arguments[0];"
+ "var evObj = document.createEvent('MouseEvents');"
+ "evObj.initEvent( 'mouseover', true, true );"
+ "fireOnThis.dispatchEvent(evObj);";
((IJavaScriptExecutor)driver).ExecuteScript(code, elem);
}
else
{
Actions builder = new Actions(driver);
builder.MoveToElement(elem).Build().Perform();
}
}
I was facing the same issue with Firefox 20. Then I re-installed latest Selenium server (.jar files).
http://selenium.googlecode.com/files/selenium-server-standalone-2.32.0.jar
Hope this works!