Specifying Windows Versions (or Specific Machines) in Selenium Grid - selenium-webdriver

I'm setting up a Selenium Grid in order to cover a test matrix that needs to comprehensively cover the following combinations: Three servers (windows server 2003, 2008, and 2012) that provide identical services and ten clients (of flavors XP, win7, win8, and win8.1) that will be accessing each of the three servers to perform nearly identical tests. The three servers part is most likely irrelevant to this question, but I threw it in for context's sake. I'm configuring which servers to use via TestNG DataProviders.
The catch is that I want to test the interactions not just between different browsers and browser versions and operating systems, but also all four versions of windows.
From what I can tell the DesiredCapabilities class will only allow me to specify between between XP, VISTA, and WINDOWS enums. I have found this question and it has been answered Selenium Grid: Capabilities and Platform.WINDOWS7?
However I wanted to post a new question for three reasons. It deals with an old version of selenium. I'm using 2.39.0 and the solution references version 2.15. Also, I have four windows platforms, so I can't use the suggested solution unless I gut out part of my test matrix. That is undesirable, but not impossible. Finally, while I have a decent understanding of the trick being used, my understanding of how overriding the enum might affect my tests is pretty big unknown.
One possible workaround I've thought of depends on how the enum is used. If it just uses the enum to search all the nodes to find a machine that has been set up with some specified capability I could assign any of the remaining platform flags to my fourth OS profile. For instance, assign the XP flag to winXP, WINDOWS flag to win7, VISTA to win8, and finally the UNIX flag to win8.1. But if the enum is used for more intense purposes I'm up the proverbial creek. Also, defining a windows box with a UNIX platform flag just seems like bad programming practice, even if it were to work just fine.
I guess what I really want is way to tell the grid "Run this test on the machine with this IP address" rather than "run this test on a machine that matches these capabilities." Has this functionality been added to selenium, or is there a workaround I'm missing?
Thanks,
Jon

You can possibly specify the IP in the node configuration json file on your node machine:
{
"capabilities":
[
{
"platform": "WINDOWS",
"browserName": "firefox",
"maxInstances": 1,
"seleniumProtocol": "WebDriver",
"nodeip": "192.168.0.123"
}
],
"configuration":
{
"proxy":"org.openqa.grid.selenium.proxy.WebDriverRemoteProxy",
"maxSession":1,
"url":"http://192.168.0.99:4444/wd/hub"
}
}
And then request the specific node:
DesiredCapabilities caps = DesiredCapabilities.firefox();
caps.setCapability("platform", Platform.WINDOWS);
caps.setCapability("nodeip", "192.168.0.123");
RemoteWebDriver driver = new RemoteWebDriver(new URL(hubUrl), caps);
Alternatively, you can possibly use the applicationName capability or the Browser Version capability to specify your IP/custom value as selenium grid does a simple string match on these. See the below google group discussions on using existing capabilities for identifying a specific node:
Using the applicationName capability
Using the Browser Version capability

Related

c-icap with Windows Defender

I was tasked to set up an open-source icap-server to scan files that are uploaded in one of our web applications.
The files base64-encoded withing the upload method and this seems to lead to the fortigate not being able to scan it properly.
Now I managed to set up an icap-server using "c-icap" and tested it with "clamav". So far it seems to work, at least EICAR files are detected.
Now the problem is, that my boss is basically a "Windows-only" person who says that any open-source AV can´t be trusted enough.
He wants me to try to have the requests/uploads sent to the c-icap server, but scanned with Windows Defender. ß Is there any - useful - way to accomplish this? Also, since I am super new to ICAP - are there any restrictions regarding which icap-server can be used?Like, is there any way to force requests to be handled with a metadefender-icap only, and not any other icap server?
Sorry if these questions are a bit unspecific and basic, but just started with ICAP yesterday!
Thank you!
Check out this link: https://techcommunity.microsoft.com/t5/windows-it-pro-blog/metadefender-icap-with-windows-defender-antivirus-world-class/ba-p/800234 to see what Microsoft offers regarding Defender+ICAP.
I have used commercial ICAP solutions in the past (like Bluecoat) that allow plugging in multiple commercial virus engines (Kaspersky, Sophos, ...).
These are appliances, and you don't need to tell your boss their internals are probably some sort of Linux ;-)
You can probably also set up a commercial antivirus solution on your Linux system and use that.
Looking at this link: https://learn.microsoft.com/en-us/windows/security/threat-protection/microsoft-defender-atp/microsoft-defender-atp-linux it may even be possible to run Microsoft's Defender on Linux. I haven't tried it myself though.
Unlike your boss, Microsoft realizes software shouldn't be made to just run on Windows anymore (even MS-SQL Server now runs on Linux).

How to transfer a file from Windows XP to a virtual machine inside vSphere 5.5?

I have a file on my desktop that I need to put onto one of the virtual machines, however when I search for solutions on how to do this many say to download third party software to do it, or to use drag and drop through vSphere. The issue is I am on a restricted network and can't install additional software, and also don't have the drag an drop functionality in vSphere.
I have seen it done in the past using the command line and the IP address of the machine I want to send it to, along with the username and password, however I can't remember the syntax. Can anyone provide instruction on what to type into the terminal to do this?
Have you given the Copy-VMGuestFile cmdlet a look from PowerCLI?
http://www.vmware.com/support/developer/PowerCLI/PowerCLI651/html/Copy-VMGuestFile.html
If you're not a fan of PowerShell, there's a couple SDK options you could use with the vSphere Web Services API. Specifically, you're looking for the GuestFileManager object and the InitiateFileTransferToGuest method: http://pubs.vmware.com/vsphere-5-5/topic/com.vmware.wssdk.apiref.doc/vim.vm.guest.FileManager.html

Determine Remote Desktop Client supported protocol version

How do I determine the Remote Desktop Protocol version supported by a particular client?
Note that I am NOT asking for the ActiveX control version but the underlying protocol version. As examples from two machines I checked using Help->About (or just About in the case of Windows XP):
On Windows 8, I do NOT want 6.2.9200, I want 8.0.
On Windows XP, I do NOT want 6.0.6001, I want 6.1.
And I am not asking for the protocol version in use in a given session (which is what Determine Remote Desktop Protocol version programatically? is referring to) because we're not in a session, we are validating a client's configuration.
Thanks!
I eventually contact Microsoft about this question and the (somewhat amazing) answer I got back is as follows:
That string is hard-coded and not retrieved from the server or AX (in
fact mstsc.exe checks the build number of mstsax.dll before loading it
to make sure it is consistent with its own build number).
So I guess I will need to fall back on hard-coded OS version information - perhaps the mstsc.exe version. That's yucky but I don't see what choice I have.

File System Filter MiniDriver

I have a Program.exe that I need to intercept. That specific program uses CreateFile & ReadFile, however I need to intercept ReadFile function.
I thought about writing my own File System Filter MiniDriver.
I found this link by Googling: http://msdn.microsoft.com/en-us/library/ff551862(v=vs.85)
It seems that is the correct way to do this. However last time I did any driver development, I remember that >= VISTA did not allow drivers to be installed easily. You needed to acquire "Signed" priviledge from Microsoft(you had to pay).
My question is that, can I create Simple File System Filter Driver for my USB stick and intercept any readings from ReadFile()? All I want to do is to allow ReadFile by a specific process.
1) I need this legally
2) I need to avoid unsigned drivers, so the driver would always work.
Will one minifilter driver work for every OS starting from XP?!
Prohibit of loading unsigned drivers is exist only on x64 versions of windows >= vista
On x64 versions you can
1) Switch to test mode to turm off this restriction
2) Add test sertificate as root to certificate storage
But if you want distribute this driver you must bay certificate.
Yes, minifilter is the preferred way for this. You can intercept system calls/IRPs and allow-deny any of them depending upon your criteria.
Also, same driver code can be used for multiple OSes, however you need to build for specific Os.
WDK 7 can be used to build drivers from XP to Windows 7.
Also, as izlesa suggested, you need to sign for x64 windows higher than vista.

Windows display driver hooking, 64 bit

Once I've written a sort of a driver for Windows, which had to intercept the interaction of the native display driver with the OS. The native display driver consists of a miniport driver and a DLL loaded by win32k.sys into the session space. My goal was to meddle between the win32k.sys and that DLL. Moreover, the system might have several display drivers, I had to hook them all.
I created a standard WDM driver, which was configured to load at system boot (i.e. before win32k). During its initialization it hooked the ZwSetSystemInformation, by patching the SSDT. This function is called by the OS whenever it loads/unloads a DLL into the session space, which is exactly what I need.
When ZwSetSystemInformation is invoked with SystemLoadImage parameter - one of its parameters is the pointer to a SYSTEM_LOAD_IMAGE structure, and its ModuleBase is the module base mapping address. Then I analyze the mapped image, patch its entry point with my function, and the rest is straightforward.
Now I need to port this driver to a 64-bit Windows. Needless to say it's not a trivial task at all. So far I found the following obstacles:
All drivers must be signed
PatchGuard
SSDT is not directly exported.
If I understand correctly, PatchGuard and driver signing verification may be turned off, the driver should be installed on a dedicated machine, and we may torture it the way we want.
There're tricks to locate the SSDT as well, according to online sources.
However recently I've discovered there exists a function called PsSetLoadImageNotifyRoutine. It may simplify the task considerably, and help avoid dirty tricks.
My question are:
If I use PsSetLoadImageNotifyRoutine, will I receive notifications about DLLs loaded into the session space? The official documentation talks about "system space or user space", but does "system space" also includes the session space?
Do I need to disable the PatchGuard if I'm going to patch the mapped DLL image after it was mapped?
Are there any more potential problems I didn't think about?
Are there any other ways to achieve what I want?
Thanks in advance.
Do I need to disable the PatchGuard if I'm going to patch the mapped DLL image after it was mapped?
To load any driver on x64 it must be signed. With admin rights you can disabled PatchGuard and I personally recommend using DSEO, a GUI application made for this. Or you can bypass PatchGuard by overwriting the MBR (or BIOS), although this is typically considered a bootkit - malware.

Resources