Jasmine in windows command-line - windows

How to run jasmine from command-line using a Windows machine ? I have seen jasmine scripts run in Linux. I want jasmine standalone in command-line without phantomjs or any other javascript code that mocks the server(I need jasmine only, if possible with maven).

I'm lost... Assuming the question is "can I run JavaScript on default Windows install, can I run tests with Jasmine this way"?
CScript/WScript will run JavaScript, both a part of default Windows install (I believe starting W2K or WinXP).
You can also compile JavaScript with .Net compiler (JSC.exe) again available on most machines (.Net is not default on WinXP - so may not be present, Windows Vista/7/8 come with a version .Net by default).
Note that JavaScript by itself has nothing to do with browser and both above tools are not going to provide you any support for browser objects. You can run logic code/manipulate files and configuration, output text.
There is some chance that Jasmine can be run from command line without browser objects - try yourself if you goal is running non-browser related JavaScript from Windows command prompt.
There is also option to automate IE and run script there (again default IE may not be latest version - but Windows 8 comes with IE 10 - should be enough for most browser related tests). You should be able to write your own automation framework (similar to Selenium) if needed, even using JavaScript...
Sample JavaScript to run with CScript /nologo launchIE.js from command prompt:
// save as launchIE.js
WScript.Echo("Launching IE to Bing"); // outputs text to console
var oIE = new ActiveXObject("InternetExplorer.Application.1");
oIE.Visible=1;
oIE.Navigate("http://www.bing.com");

Related

How can I use Sikuli4Net or SikuliSharp with Visual Studio for Mac to test .NET Core cross platform applications on MacOS?

I have a cross-platform desktop application written in Xamarin.Forms that runs both in Windows and MacOS. I want to do some UI automation on top of that application.
After some research it seems like the most cross-platform friendly option is to use Something like Sikuli. As the default stack on our team is centered on the .NET stack we want to use SikuliSharp or Sikuli4Net to perform the automated UI tests.
However, despite of the fact that we've been able to run Sikuli4Net successfully on Windows, automating several flows so far. We have a dire situation on MacOS. Our team (myself included) doesn't have a lot (or maybe any) knowledge of Java applications.
I've installed the JDK 8, but was unable to run the tests in the same way we did on Windows. The code builds, but it seems like something in the environment is lacking.
With Sikuli4Sharp when starting the APILauncher like this:
launch = new APILauncher(true);
launch.Start();
I get the following error:
With SikuliSharp when trying to run a simple demo application on our software I have this error:
I have tried to set up the SIKULI_HOME environment variable using this answer as a reference, but still the same problem (and I did restart the console and IDE, even my machine).
When I run echo $SIKULI_HOME on the terminal I do get the directory that cointains the .jar files:
So I'm kind of lost about were to go from here. These problems made me unsure about being possible to run Sikuli4Net or SikuliSharp on MacOS environments. Is this the case? If not, what am I doing wrong?
as mentioned in the error message: sikuli-script.jar is missing.
You have to check on what version of Sikuli/SikuliX your SikuliSharp or Sikuli4Net are depending on.
In doubt you have to dive into the sources of those Net packages.

How to run UFT script without having UFT installed

I want to know whether is there any way to run script written in UFT without having UFT installed in your PC.
Can we export Script to some .vbs or .exe file? Or is there any alternate way through which we can execute scripts?
If you had developed the scripts using Object hierarchy, then you cannot run it without UFT. Scripts having only VBScript commands can be executed as .vbs, but we cannot do activities on Objects then.
But you can run UFT in Remote Desktop by providing it as parameters in 'CreateObject("Quicktest.Application",Remote Ip)'. Other than this, it is not possible to execute a UFT script outside UFT.
You can't execute scripts without UFT installed. That being said, from UFT 12.50 onwards, HP is providing a standalone component called as "Run Time Engine". Here is the snapshot.
The HP Unified Functional Testing (UFT) Runtime Engine is a core component
of UFT which enables you to run various tests (GUI, API and BPT) in functional
testing. In previous UFT versions, this feature was only available with the full
UFT installation. However, beginning with version 12.50, you can use the Runtime Engine as a standalone installation option for your automated testing environment.
Reference
Definately possible.
UFT has introduced a new feature called LeanFT . It just requires installation of LeanFT jars and requires a method to call them
You now can with the UFT Runtime Engine. More information can be found at this link.
From that site:
The UFTRuntime Engine enables you to run UFT tests (both GUI and API)
and business process tests on your computer without installing the
entire UFT IDE. In addition, you can also install the Runtime Engine
without the Run Results Viewer, UFT Add-in for ALM, sample
applications, or Help documentation. This can potentially save you
valuable disk space on your computer
You need UFT 14 v or above to make it use.
UFT 12 doesn't have that this feature

Polymer tests never end on windows machines

I've developed an application using Polymer 1.0. My developer computer is a Mac, and I've not had any problems during development process.
However, when I clone my application on a Windows machine (Windows 10), the tests don't work at all.
Whenever I execute polymer test or wct the command blocks the terminal and never ends.
On MACOS or Linux it works perfectly.
The following environment variable values have saved me in Win10 environment:
LAUNCHPAD_BROWSERS=chrome
LAUNCHPAD_CHROME=C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
It is not obvious from Polymer and launchpad documentation the need to set only single browser with known location to minimize the test run time during ongoing development. Of course for multiple browsers autodetection it will take more time and traverse over all PATH with guess on all possible browsers takes forever. It would be reasonable not to rely on auto-detection and list in LAUNCHPAD_BROWSERS only browsers you have set in LAUNCHPAD_xxx location.
I finally found a workaround.
It seems that there is a bug in Web Component Tester. When it tries to find all the browsers installed on a windows machine it takes ages to locate some of them.
To solve this problem, just adds an environment variable that tells WCT which browsers are installed, so it can skip this step:
LAUNCHPAD_BROWSERS= _{coma delimited list of browsers}_
For instance:
LAUNCHPAD_BROWSERS=chrome,firefox,opera
Once this variable has been set, all the tests execute just like on any other OS.
More information about this feature here

Starting webDriver endpoint in current users's desktop from linux through powershell

I have a test cluster that contains a linux machine, an iMac and a windows 7 PC.
The linux machine hosts junit tests that I wrote and the other two machine serve as endpoints for browser automation tests using webDriver.
The script that executes the junit tests loops through different browsers and executes the junit tests against each browser using selenium webDriver. So far, the browsers include iphone, ipad, safari (mac), firefox (mac), chrome (mac), IE10 (win7), firefox (win7), chrome (win7).
While developing this test cluster, I encountered random crashes of webDriver on each of the two endpoints and found it necessary to write a kill/restart of the webDriver jar file. Now, this was a relatively simple matter on the iMac, but on the Windows 7 PC this is proving to be extremely difficult.
The linux machine has a script that checks to see that the webDriver endpoint is available by checking http://windows.Host:4444/wd/hub/status and if it isn't, it shells into powershell on the Windows 7 PC (I have freesshd setup to point to powershell instead of cmd.exe) and runs these commands:
Stop-Process -name java
Start-Process -FilePath C:\webDriver.bat
webDriver.bat contains:
java -jar C:\selenium-server.standalone-2.33.0.jar
Here is the problem I am having:
when powershell restarts webDriver using the above comands, the wedDriver endpoint is reachable but not visible. My tests proceed but fail because the browser is not running in the current desktop but instead some virtual one or another users Desktop. When I run webDriver.bat manually, webDriver runs in a cmd.exe window and the tests execute against all win7 browsers fine, providing webDriver doesn't crash.
Here is my question:
How do I make webDriver execute in such a way that my tests proceed and run correctly, rather than in the background/another user's desktop? These tests are part of Build Verification and need to be run on demand, so having someone manually run webDriver.bat is not an option.
I previously tried to have webDriver's jar running as a service and using samba to restart that service as needed, but ran into the same problem. Powershell seemed to be a better alternative with better control and the ability to verify that the jar file is running, but I don't know if I am heading in the wrong direction here.
I don't relish having to learn powershell to accomplish something that was relatively easy on another OS, but understand that this may be my only option. I also know that the commands I'm using do not constitute a good script and welcome suggestions on how to better achieve my goal here.
Thanks.
Sounds like you just need to pass the host option like so:
java -jar selenium-server-standalone-2.37.0.jar -host 0.0.0.0
Powershell might have permission restrictions on binding to all ports that can be overcome by setting the correct policy. See my blog post here for ideas.
You question is pretty long winded...can you shorten it?

firefoxProfileTemplate doesn't prevent certificate prompt in Mozilla

I am running Selenium Server. I'm also launching an automated test script that I exported from the Mozilla Selenium IDE and exported to my Java client driver program which I compiled and ran in Eclipse using JUnit 4.8. Two windows start up in Mozilla (since I'm using the "*chrome"/Firefox argument when instantiating my browser window object from the Java program). One window looks like it contains logging information of some kind, and the other window is the actual automated test browser window.
Here's how I'm starting the Selenium Server.
cd C:\Program Files\Java\jdk1.6.0_26\bin\Selenium
java -jar .\selenium-server-standalone-2.0rc3.jar -interactive -firefoxProfileTemplate "C:\Users[Windows-Login]\AppData\Local\Mozilla\Firefox\Profiles\lcllklng.default"
The server starts up fine. The reason I put the -firefoxProfileTemplate attribute into the start-up command because I kept getting the untrusted certificate in Mozilla. I guess this is supposed to default my Windows login Mozilla profile. However, it didn't work. I have to click through the prompts each time I run my test cases. Is there a way to make it avoid the untrusted certificate? Could it be because I'm running Windows 7?
You'd also be my hero if you can help me avoid this for IE, Google Chrome and Safari. But only if you feel helpful today. Thanks!
Switch to WebDriver to avoid this.

Resources