By default phantomjs uses chrome capabilities. Is it possible to run it with IE capabilities .If so, I need to use it for page-object gem like:
#browser = Watir::Browser.new(:phantomjs, args: '--ignore-ssl-errors=true')
Can any body please provide me any solution for it.
The quick answer is no: Phantom is using the same WebKit rendering engine that Chrome/Safari uses (*), so cannot act like IE.
You might be interested in TrifleJS which is a headless IE port of PhantomJS. (The project is in the early stages, and (AFAIK) won't work with CasperJS yet, and does not seem to support selenium integration either yet.)
*: More precisely, Phantom 1.9 is equivalent to about Chrome 13. And recent versions of Chrome use Blink, not WebKit. So Phantom 2.x, when finally released, won't be equivalent to any version of Chrome.
Related
I am writing to ask about --disable-features=SameSiteByDefaultCookies feature which was part of chrome earlier.
I am working with IT MNC and recently we promoted very important functionality to Production. We have started charging customer for this. It is legacy application .
This application can't be tested locally anymore! Earlier we could point out application to lower environment with custom settings in project's config.js file and disabling #same-site-by-default-cookies in Chrome and application could be tested locally. But now we can't!
We tried many different settings and debugged but it could not help !!
It is noted that these settings no longer work in Chrome 94+. These flags are removed entirely.
As per my analysis it is found that application still can be tested locally if we get the portable Chrome. Or older version of Chrome installed in our System. However as per the compliance policy of company and client, we can't get old or portable chrome in system. We have latest version only.
Earlier we used to perform following to run it locally:
Open CMD
cd to Chrome path ( Till Application )
Fire the following command:
chrome.exe --disable-web-security --user-data-dir=C:\XXXX\XXXX\localwlp --disable-features=SameSiteByDefaultCookies"
This would open a new window of Chrome ( Close all before firing the command) and then we could test the application locally.
Anybody is aware about the alternative for this? That would be really helpful. We can't test the application locally so for even small changes, we require to deploy on lower environments which takes a lot of time and also code will work or not can't say.
I look forward to hearing from you all guys.
Thanks,
Kailash Nirmal.
Does anyone know whether Driver exe for New Microsoft Chromium Edge Available ?
If Yes, please share link.
Thanks.
Yes, it can be found here:
https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/#downloads
It's version 75 but I've been testing it out and it works fine with Edge 76. Make sure that you have the correct Edge executable on your path depending on whether you have Dev or Canary.
Dev:
C:\Program Files (x86)\Microsoft\Edge Dev\Application\
Canary:
C:\Users\boni\AppData\Local\Microsoft\Edge SxS\Application\
There's a bit more info on my other answer:
I wouldn't recommend testing Canary, as it's unstable and it changes so fast, maintaining results will not be fun. I'm testing Dev and I'll switch to Beta when that's released.
Just a point regarding Dmitri's answer about market shares:
While accurate, they are global figures, so may be entirely irrelevant to what you're testing. If for example you're developing web applications for businesses, it's not unusual to find that the vast majority of your users are on IE or Edge, because companies have policies about only using Microsoft browsers. Sometimes this is about perceived security, but more often than not, it's about supporting legacy systems and documents, which can only be viewed in IE or chromium Edge's IE mode.
I would not go for automation till official release of the EdgeChromium-based browser from Microsoft, moreover looking into current browser market share I don't think you should be investing any efforts into it.
Chrome 61.75%
Safari 15.12%
Firefox 4.92%
UC Browser 4.22%
Opera 3.15%
IE 2.8%
Edge 2.15%
Others 5.89%
Just in case if you still want to assess the EdgeChromium automation the driver is available since 24th of April 2019 at normal Edge Driver downloads page
For example direct link for MS Edge 75 driver:
https://msedgecdn.azurewebsites.net/webdriver/index.html
I'm using protractor for testing. 99% of the times there's no need to actually see the browser, the tests take a long time, and all we're interested in is the final outcome.
Is there a way to hide the browser opened for testing (e.g. run in the background)?
As stated before, docker-selenium works wonders. The only browser not supported by docker-selenium is Internet Explorer, for obvious reasons.
From what I understand, you cannot really reliably control the way browser windows are opened via protractor/webdriverjs/selenium.
A common way to approach the problem is to use a virtual display, see:
Can Selenium Webdriver open browser windows silently in background?
An alternative way to accomplish that, would be to run tests inside a docker-selenium container, here is a quite detailed introduction:
protractor with any headless browser?
Or, as pointed out here and if you are on Mac OS X, you can run selenium tests on the same machine but under a different user which would not interfere with your current display.
You can also run protractor tests in a docker container in a headless firefox:
Protractor-Firefox-Headless-Docker
Another alternative would be to use a remote selenium server, as, for example, BrowserStack or Sauce Labs services provide.
You can try headless browser like PhantomJS for this purpose. PhantomJS runs in background and failures can be captured using screenshot.
Refer following link to know more about phantomjs:
Protractor running tests on PhantomJS
I've been trying to get Internet Explorer 11 to run under Protractor to complete a suite of tests I have for an new AngularJS project.
I'm running under Windows 7 - 64 Bit and have downloaded and installed the Selenium IEDriverServer.exe for 64 Bit.
When I go to launch Protractor and run the scenarios, Internet Explorer comes up and navigates to the page just fine, but when the scenario sends keys to an input field it is extremely slow, like about 15 seconds between each key press. And Selenium is not showing any type of exception being thrown.
Has anyone seen this behavior before and found a solution?
Thanks
It's a known bug or "issue" (not a bug within the IEDriver however):
http://code.google.com/p/selenium/issues/detail?id=3072 (references IE10 but the point & solution is the same fundamentally)
It is explained in the Selenium issue tracker, but the workaround will be to use the 32bit version of the driver. Realistically you don't get "much" from using the explicit 64bit version.
I'd also say you may have further problems with IE11. Selenium doesn't support IE11 fully yet.
https://code.google.com/p/selenium/issues/detail?id=6437#c7 (among other issues)
You are probably, long term, better off downgrading to IE10 and using the 32bit driver.
I have implemented the following technology stack for automated unit testing in the browser.
Mocha -> Selenium -> Phantomjs
I followed this example:
http://net.tutsplus.com/tutorials/javascript-ajax/headless-functional-testing-with-selenium-and-phantomjs/
I suspect that there might be a bug in the "send keys" command between Selenium and PhantomJs. I do not have any experience in these 2 technologies, so I suspect it is rather me making some configuration mistake.
Basically what happens is that the characters sent by Selenium is not all applied by PhantomJs.
I switched PhantomJs out with Firefox and there it works like a charm.
The Selenium output for the 2 drivers are exactly the same. So I am left with suspecting a bug in PhantomJs or Ghostdriver. But as I said it might just be me not configuring the thing correctly. Given that this is quite a big issue I really suspect that is the case.
I am also not 100% sure where to log this, if this is indeed a bug.
There were a couple of issues with sendKeys fixed recently.
https://github.com/camme/webdriverjs/issues?page=1&state=closed
Are you running the latest version?
If not I would log a bug there about it.