Execution of CodedUI tests on Remote machine without using the TestAgent/Controller - batch-file

I have few Ordered tests which I execute locally using the VSTEST.CONSOLE.EXE In a batch file. I want to launch this batch file from remote system on about 15 VMs. I have the desktop active on all the VMs and user under which these test cases need to be executed are also same as the user logged in. When I try to execute the batch file using the PSExec it throws an error and dosent launch the tests the error shown is as below
C:\TestRunningFolder>vstest.console.exe C:\BuildsFolder\BVTTests.orderedtest /Settings:C:\BuildsFolder\QuestCodedUI.testsettings /Logger:trx
Microsoft (R) Test Execution Command Line Tool Version 12.0.30723.0
Copyright (c) Microsoft Corporation. All rights reserved.
starting test execution, please wait...
Warning: Warning: Test Run deployment issue: The assembly or module 'UiaComWrapp
r' directly or indirectly referenced by the test container 'c:\BuildsFolder\questcodedui.dll' was not found.Error: Test host process
exited unexpectedly.
Error: Failed to queue test run 'testuser#RemoteMachine 2015-05-14 15:57:49':
Unable to start the agent process.
Please let me know how can I execute the CodedUI tests on remote machine without using the TestAgent/Controller. Is it possible Via WMI ?. Anyone tried and succeeded please let me know.
Update : I was able to get past this issue by copying the required files in the folder. Now I am trying to launch the CodedUI tests using the PSExec.exe on remote system. I have remote desktop active and when I try to launch the batch file using the command line and it just gives me a message as shown below. PSEXEC.EXE \RemoteMachinename -i "c\users\testuser\desktop\Runtests.bat" when I do that it returns with error code 1 and tests are not started yet. I tried searching for solution I couldn't find anything that is usefull.

For the above mentioned scenario, please copy all the dependency dll (eg : Microsoft.Visualstudio.Qualitytools.CodeduiTest etc.) to the folder where your build dll (projectname.dll) file is copied. Make sure that you are using correct version of vstest that supports the version of the VS you are using. For example, if your code is builded using VS 2015, you have to use vstest.console.exe that comes with Test Agent 2015/Test Agent 2013 Update 5. This trick worked for me. Please let me know whether this works for you. Regards.

Related

Error in Selenium tests triggered from batch script in TFS Build step

Step 1. I have written selenium tests and bundled it into executable jar.
Step 2. When I execute this jar tests runs normally. Invokes New browser and execute all steps.
Step 3. I created bat file to execute this jar. In this case also test execution happens normally.
Step 4. TFS Build integration. (TFS 2015)
- I created new build definition in TFS
- Added build step "Batch Script"
- Entered path of bat file created in step 3 in build step
- When I Queue this build. bat file gets called and test execution starts. But It does not open new browser..console says Started IE driver...it starts driver internal to build agent. and execution fails on setting value in textbox.
Click to see TFS Build Cosole
I can't use Visual studio tests. Requirement is to selenium tests should be triggered from jar created on Step 1.
Make sure the build agent is running in interactive mode.
First you could try to RDP to the remote build server(the build agent located) and manually run the batch file to see if it works.
If it's also not work then the issue may related the IE browser on the server.
If it works then maybe the TFS build service account don't have enough permission to run the IE driver. Please make sure the build service account has local Admin permission on the build server.

KNIME Command Line Execution - ClassNotFoundException

I'd like to schedule a KNIME workflow. The workflow does its job very good as long as I start it from the KNIME GUI application. When I execute the same workflow via command line, java complains that com.microsoft.sqlserver.jdbc.SQLServerDriver
could not be found (ClassNotFoundException).
I invoke it via:
"D:\Progamme\KNIME\knime.exe" -nosplash -application -consoleLog org.knime.product.KNIME_BATCH_APPLICATION -preferences="absolutepathto\preferences.epf" -workflowDir="absolutepathto\workflow"
Since the error message signals missing content in the java CLASSPATH I also tried to add the parameters
-vmargs -classpath .;"absolutepathto/sqljdbc42.jar"
But still I earn a java slap, pointing to the same error...
I also tried to run the command from within the knime.exe's directory and I also tried to add the JAR file to Preferences -> Java -> Build Path -> Classpath Variable / User Libraries (referenced via the -preference argument). But that had no effect.
Did anybody face the same problems? Maybe with other third party JARs?
It is all about a Database connector that is configured like this:
Does the integrated security maybe force a misleading error?
System spec: KNIME 3.2.2 on Windows Server 2008 R2
Update - extract from preferences file
/configuration/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true
/configuration/org.eclipse.ui.ide/MAX_RECENT_WORKSPACES=10
/configuration/org.eclipse.ui.ide/RECENT_WORKSPACES=<list of some workspaces>
/configuration/org.eclipse.ui.ide/RECENT_WORKSPACES_PROTOCOL=3
/configuration/org.eclipse.ui.ide/SHOW_RECENT_WORKSPACES=false
/configuration/org.eclipse.ui.ide/SHOW_WORKSPACE_SELECTION_DIALOG=true
Is there maybe a problem due to the fact that it is a shared KNIME instance among several users and the command line execution does not know which workspace has to be chosen? Is the workspace somehow needed and why?
Partial Solution:
I finally managed it but I don't know exactly why it works now. What I did was to load a fresh portable version of KNIME and ran the same commands only changing the executable path to the new portable version. Before that I started the portable version once to set the workspace directory and register the database driver in preferences dialog and .ini file, nothing else, same configuration so far as the shared KNIME instance. What I am really wondering abpout is that from now on the commands are also working with the shared KNIME instance. I really don't know what caused the change that let KNIME find the driver class.
Info
Because I encountered a few more problems within shared environment in KNIME command line mode, that led to undeterministic execution results, I wrote a little .NET library. This gives me more flexibility/control over the workflow execution (which returncodes and error messages occured and so on). You can find it here if you're interested: KnimeNet
I took a very minimal approach:
cd "C:\Program Files\KNIME"
.\knime -nosplash -noexit -consoleLog -reset -application org.knime.product.KNIME_BATCH_APPLICATION -workflowFile="D:\Work\Knime Workflows\Output\CMD_Test.knwf" -preferences="D:\Work\Knime Workflows\Output\CMD_Test.epf"

Jenkins/Windows - Launch TestNG suite from .bat

Stackoverflow helped me a lot to reach that point but now I'm completely stuck, here is my problem :
I'm currently developing several tests to check a website. I code with Java in Eclipse, using testNG plugin with ReportNG for report, all of this using Windows 7 pro.
My tests work, and my report is well generated, so now I have to put it on Jenkins for my company so they will run my tests every X hours.
In order to launch my tests, I have made a file, named Run.bat, which runs the Java code, I tested it and it works, here is the code :
Run.bat
set classpath=blex_test_v1\bin;blex_test_v1\lib\*
java org.testng.TestNG blex_test_v1\blex_test_v1.xml
I now try to launch the tests on Jenkins, creating a new job and configuring it with the build section :
Run.bat
And this is my problem, I've tried everything (relative path, only the name of the file etc...) I always get this error :
java.io.IOException: Cannot run program "cmd" (in directory "/var/jenkins_home/jobs/blex_functional_test/workspace"): error=2, No such file or directory
So I checked the Jenkins workspace but my Run.bat is in it :
Workspace
I have read that Jenkins is in Linux so it might cause problem with bat files, so I tried to create a script but I didn't succeed either ..
So my question is : How can I run my test on Jenkins using my file Run.bat ? What am I doing wrong here ?
Thanks a lot !
Finally I can add an answer :
Jenkins is installed on a Unix machine so you can't run a bat file, it has to be a bash script.
To create a bash script, refer here.
Then you have to make sure that the plugin Xvfb is installed (and works) on the computer where Jenkins is installed.
I use testNG with reportNg and it doesn't work with the last firefox version so you I use firefox v34.0.5 and this version must be installed also on the Jenkins computer.
If you want to open the report after the execution, install another plugin and configure it (report HTML or something like that)
God it took me about a week but it's good to see it working !

Getiing error message 'Failed Installing JBAS50SVC' whle running service.bat file in Windows 7

I need to run Jboss 7 as service.
Followed these steps :-
Copied my Jboss to C:\Program Files <86>
Downloaded Jboss-native-2.0.10-windows-x64-ssl and copied the contenst of bin catalog to %JBOSS_HOME%/bin
Changes done on service.bat as per link instructions
https://community.jboss.org/message/724488
Changed my dir location to my Jboss bin
and given command service.bat install
C:\Program Files \jboss7>bin>service.bat install
Failed installing JBAS50SVC
Access is Denied.
Service JBoss Application Server 7.1.1 installed.
I'm not able to rectify this problem .
It appears to be windows access issue.
Try the following:
Does the windows ID you are using have Administrator privileges? If no, get a Admin ID else if Yes, proceed to step 2.
Try to do the same but in some other drive (not c: )
UPDATE #1 : OP says he can not see the output of service.bat file
Follow the following steps
Open start menu
Search for "cmd"
Right click "cmd" and run as Administrator
type in following command
cd C:\Program Files \jboss7\bin
Type service.bat and observe the output
On a 2008 Windows Server this occurs because you're not running the command line as an administrator. Those of us who have spent considerable amounts of time on 2003 server, and others before that, keep forgetting that your logged in ADMIN level account does NOT get passed to the command line automatically like with previous versions of Windows.
With any additional errors, past this one, I would keep going back to the service.bat file and looking at the path statements, throughout that file, to ensure that they are all correct to reach what is correct for your installation.
Also, don't forget to create a log folder under standalone (unless you're doing a domain install). Failure to do that will also cause issues as well.
yoda

How to install Crystal Reports for .Net 3.5 Winforms application

We have a VB.Net Winforms (x86) application that uses the freely redistributable version of Crystal Reports. Although the application works fine on my test machine, when installing on a client's machine and trying to print a report from the application, the error: The system cannot find the file specified. File name: 'CrystalDecisions.CrystalReports.Engine ... is displayed.
The inno-setup includes the CR redistributable "CRRedist2008_x86.msi" which was installed by the client during the installation. (We also tried running the "CRRedist2008_x64.msi" but received an "unsupported processor type" error).
I have read about Merge Modules that are prerequisites for .NET 1/2 (VS 2002/2005), but cannot find any useful information related to .NET 3.5 and am wondering if these files are still required and how to package and deploy them if they are in fact needed.
Any guidance on how to resolve this installation issue is much appreciated.
Edit
The Inno-Setup contains the following command that checks to see if CR is installed and if not the MSI is launched from the final setup form:
[Run]
Filename: "{app}\CRRedist2008_x86.msi"; Description: "Crystal Reports"; Flags: nowait postinstall skipifsilent; Check: EnsureCrystalReports105Installed();
The problem is that you are not actually executing the MSI file. You can see this by running your installer with /LOG and reviewing the resulting log file.
This is because MSI files cannot be directly executed -- they're data files, not programs.
To resolve this, you need to run msiexec instead, passing the MSI file as a parameter; eg.
[Run]
Filename: {sys}\msiexec.exe; Parameters: "/i ""{app}\CRRedist2008_x86.msi"""; ...
You should review the command line parameters accepted by msiexec and properties accepted by the MSI file to see if you want to do something different, eg. running the install silently instead of interactively.
Also, running it as postinstall is fine if this component is optional for your application and it can gracefully handle it not being installed. If this is not the case then you should treat it as a prerequisite instead and always install it via PrepareToInstall.

Resources