What is a passthrough mode in selenium - selenium

I recently came across something called the passthrough mode in selenium changelog. I quite did not understand its use. can somebody explain about it.

The enablepassThrough mode was added to support the new w3c standard
Words from Simon Stewart:
I've added a "-enablePassThrough" flag to the standalone server. With this in place, and a few tweaks to Grid, it's possible to use a w3c remote end (eg. geckodriver) with a w3c speaking local end (eg. a recent 3.x release of selenium) It'll be in 3.5
Notably, this means that you'll need to start the nodes with "-enablePassThrough".
Please the below issue
Grid does not handle w3c capabilities correctly #3808

Related

running selenium tests via jmeter on blazemeter remotely

We have a jmeter test that launches selenium scripts using the chrome driver config plugin which runs with the Web Driver Sampler, with which we are uploading our own chrome driver. The driver wont be allowed to work though, we keep getting
java.lang.IllegalStateException: The driver is not executable: /tmp/artifacts/chromedriver
we need a way to chmod +x the driver or something similar. is there a way to do this?
Blazemeter support said
JMeter's Webdriver plugin has been deprecated and is not supported on BlazeMeter
but I don't see anything deprecating the webdriver plugin from jmeter The repo and main website seem updated and active.
https://github.com/undera/jmeter-plugins-webdriver
https://jmeter-plugins.org/wiki/WebDriverSampler/?utm_source=jmeter&utm_medium=helplink&utm_campaign=WebDriverSampler
TL/DR: Can we run a selenium test from within a jmeter test using a <com.googlecode.jmeter.plugins.webdriver.sampler.WebDriverSampler on blazemeter? what are the steps to do so?
I hit this exact issue, this is probably too late for you but I thought it would be useful to answer for someone else in the future.
According to this Blazemeter Post titled:
"Using Selenium with JMeter's WebDriver Sampler"
"To launch the WebDriver test in the cloud with more concurrent users on BlazeMeter, use Firefox, which is the only currently supported browser for use with WebDriver. Create a new test and upload your JMX file to run it."
So in summary, only firefox is supported, not chrome within Blazemeter.
I work on a lot of BlazeMeter's documentation and can verify the previous answer -- the Webdriver plugin for JMeter is no longer supported on BlazeMeter.
That's not to say you can't get it to work -- you might -- but it's not supported (i.e. the support team can't assist with any problems that arise with it).
Some added context: We know folks in the plugin development community, which is how we learned the plugin is "deprecated" in the sense that there's not much in the way of future development for it going forward. You're right though - it's not documented anywhere, unfortunately. I can't speak to why that is on the plugin side, but that's why it is no longer supported on the BlazeMeter side.
The other reason it's no longer supported is that we recently introduced a new feature to replace it, our "GUI Functional Test" feature in BlazeMeter, which lets you run Selenium tests either through our BlazeMeter UI or from your own IDE, then watch a recording of what happened in the browser afterward. We have a set of guides covering the topic, starting here:
https://guide.blazemeter.com/hc/en-us/articles/360000700158
We also introduced a means to run a Selenium test alongside a JMeter test, via what we call our End User Experience Monitoring feature, detailed here:
https://guide.blazemeter.com/hc/en-us/articles/360000262118
(That blog post referenced above is a very old one that unfortunately no longer applies today. I regrettably don't work on the blog side of the house, so I don't have the authority to update that one myself.)
Lastly, please let me know if there's any pain points in our docs that we can fix. I've been putting a lot of work into improving and expanding our existing documentation, so feedback is always welcome.

Selenium RemoteWebDriver and Windows Authentication Dialogs

I've seen this question has been asked a few times, and lots of solutions get suggested - but none of them seem to work for the RemoteWebDriver (ie: using Selenium Grid). They're usually centered around using the local ChromeDriver/FirefoxDriver/IEDriver classes.
I am using the .NET bindings, by the way :).
What I want to do is fairly simple (in terms of requirement). I have a Selenium Server setup, and am currently using the RemoteWebDriver to perform automated UI tests on various sites. This setup is working fine.
However, some sites use NTLM/Windows Authentication, and we need to start writing automated tests for these. However, as far as I can tell, there is no solution for this.
I have seen the following "solutions", but - unless someone can correct me - they either don't work consistently, or will not work using RemoteWebDriver:
Using the IAlert functionality (like here). However, this isn't implemented in the .NET bindings, and doesn't work for all browsers as far as I can tell.
Using the Robot API to interact with the popup (like here). But this is for running on your local machine, and not supported by RemoteWebDriver.
Using AutoIt to do a similar thing to the Robot API. However, this won't work using RemoteWebDriver.
Passing the credentials in the URL (eg: http://username:password#example.com). However, this doesn't work for Windows Authentication - just normal HTTP Basic Authentication.
I can't actually see any other solutions, unless anyone else can help?
A workaround currently is to log onto the Selenium server, go to the sites in each browser, and save the credentials. But this isn't ideal, and adds a level of manual interaction to each test.
Any help would be appreciated :).
It appears I have found my own solution - use a proxy which adds the NTLM negotiation/authorisation automatically. Pretty simple to setup :).
http://cntlm.sourceforge.net/

How to change browser mode on IE with selenium?

I'm trying to run a different browser mode on IE with selenium using c#. Here's some code:
var ieWebDriver = new InternetExplorerDriver(#"PATHTOWEBDRIVER");
ieWebDriver.Keyboard.SendKeys(Keys.F12);
ieWebDriver.Keyboard.SendKeys(Keys.LeftAlt);
ieWebDriver.Keyboard.SendKeys("b");
ieWebDriver.Keyboard.SendKeys(Keys.NumberPad7);
I can open the developer tools (f12) but I'm not able to change the browser mode. Is IE preventing this due security? if so, are there any other ways to render content with a lower IE version?
thanks
No. The IEDriver is going to launch whatever IE is installed on the machine.
Changing the 'browser mode' is not a true representation of that version you are changing it to. IE9 on IE7 Standards Mode is not a true version of IE7.
Thus, you are stuck in a problem. You want to test different versions of IE, how do you do it?
The problem is that Windows let's you only have one IE version on a Windows PC at any one time. Yes, there are hacks and programs around to get multiple versions (IE5 and above) to run on a single machine, but they are hacks. Hacks which are not going to work all that well, and still, even with this, you wouldn't even be able to give the IEDriverServer the flexiblity to do this.
You will have to have seperate Windows machines.
A workaround, which again is a hack, is to set browser emulation mode in the registry, as documented in SO question.
Note that in the above question, the accepted answer is not going to work but the other answer may do. As note the comment on that answer, is by the maintainer of the IEDriver itself, advising strongly against this.
Another workaround, I have not tested, is perhaps use the native C# Keyboard.SendKeys, as documented here in MSDN. Am unsure if it will work (don't think anyone has ever ried it), but it is another option.
Selenium supports cross-browser testing of different versions of the same browser, but it is not achieved by switching the version in the Browser Mode in F12 Tools.
See https://code.google.com/p/selenium/wiki/Grid2
You can set up virtual machines with different versions of IE that work as Selenium nodes and use Selenium Hub to connect to them. Let's say you have a virtual machine with Windows 7 which has IE9 installed. You would start a Selenium node there and specify that it accepts requests for IE9 tests. You would then create InternetExplorerDriver for version 9, connect to the hub and run the test. The hub finds out the node with IE9 and runs the test there.
Related post here:
https://stackoverflow.com/a/8524216/1080590
This is of course different to what you're trying to do on a single machine, but it's more reliable and prevents you from extra management of your local IE instance.

Does anyone know browser emulators?

Over 2 years I tested web application with help Selenium framework. I know the best design is testing on VM.
The only one downside of this - it's very slow testing. Why?
browser only gets so much memory, if you will run several instances.
site coud be very slow.
connections can be very slow.
Would be great if there was a framework that emulated the browser (engine/core) correctly and can provide some results (api) for surf on the page.
I don't mean to simulate just on the one browser with different version (like IE). I mean to simulate for all browsers with very popular and newest version.
Does anyone know a framework/tool that can do it?
Thank you.
You can try PhantomJS for example.
From their page:
PhantomJS is a headless WebKit with JavaScript API. It has fast and
native support for various web standards: DOM handling, CSS selector,
JSON, Canvas, and SVG.
You can use it in combination with Jasmine (as well as several other frameworks) for testing.
However the selection of available engines is limited to WebKit. I doubt that Selenium will be easy to replace. By the way it looks like Selenium will probably become a W3C standard over the next years.
You can also run Selenium with Xvfb - I use it to execute test on remote server and it is going very well.

what does "*firefoxproxy" or "*iexploreproxy" do

I am researching the selenium and I don't understand "*firefoxproxy" does for ? I can use selenium well with just "*firefox". Please explain to me when we will use that mode ?
From the Selenium documentation:
"...additional run modes of *iexploreproxy and *firefoxproxy. These are provided for backwards compatibility only, and should not be used unless required by legacy test programs. Their use will present limitations with security certificate handling and with the running of multiple windows if your application opens additional browser windows."
http://seleniumhq.org/docs/05_selenium_rc.html
So just stick with *firefox.