IBM MobileFirst Test Workbench - Running a test from the command line - ibm-mobilefirst

I am trying to run a test from the command line using the cmdline.bat file, as suggested in https://www-01.ibm.com/support/knowledgecenter/SS2HS7_8.6.0/com.ibm.rational.test.lt.common.doc/topics/truncmdln.html
It is not like I am not getting some activity, but I haven't been able to understand how it properly works.
This is my current command:
D:\Eclipse\eclipse\plugins\com.ibm.rational.test.lt.cmdlineexecute_
7.2.960.v20140710_1337>cmdline.bat -workspace C:\MobileFirstWorksp ace -project Test -eclipsehome D:\Eclipse\eclipse -plugins D:\Eclipse\eclipse\plugins -suite prueba2.testsuite -results
newResults
It runs for 45 to 72 seconds. My CommandLineLog.txt file shows the following:
Adaptador convertido en instancia con D:\Programacion\Eclipse\eclipse
log4j:WARN No appenders could be found for logger
(org.apache.http.impl.conn.PoolingClientConnectionManager). log4j:WARN
Please initialize the log4j system properly. 2015-04-08
17:18:20.810:INFO:oejs.Server:jetty-8.1.14.v20131031 2015-04-08
17:18:20.847:INFO:oejs.AbstractConnector:Started
SelectChannelConnector#0.0.0.0:7878 2015-04-08
17:18:20.849:INFO:oejs.AbstractConnector:Started
SelectChannelConnector#0.0.0.0:7080
But I can't find any results file, there are no results files in the directory I ran the command or either in the Test project folders. Does anyone know where should I find those files?

It seems you have not a device connected to your workbench.
In order to get a result :
You should first launch RTW in the classical way with the ui.
Then you have to launch a simulator or a device and connect it to your workbench through the iOS Native or Web client (Of course, the instrumented app should be installed on the simu/device).
Siwtch to the passive mode (on the client).
You could now close the workbench.
Finally just launch your command line as you did before.
The workbench will start and wait for a client to be connected, ... after 30 seconds maximum the iOS Client (native or web) will connect to the workbench and the playback should start.
Hope it will help you.
Best regards, Alexandre.

By default, the reports are generated in your workspace and have the extension .moebreport (it's an zipped XML file)
You can ask to export it at the CLI with a preference. Open the prefs and go in Test > Performance Test Reports > Export Reports and select Command Line and Mobile and Web UI
Thanks.
Dominique

Related

Test instrumentation process crashed - where is the .txt file?

Sometimes, while Espresso testing, I see the following exception.
Test instrumentation process crashed. Check package_name.TestName#methodName.txt for details
Where is this .txt file stored? I can't seem to find it anywhere.
Use Case
In Jenkins (CI), I want the logs to see exactly what stacktrace caused the crash.
If you are working with an emulator, in A.S open Device File Explorer and go to:
/data/user_de/0/android.support.test.orchestrator/files/, then you can look for a particular file there
EDIT: June 25 - 2019 >> If you have updated to AndroidX dependencies, then the .txt file is located in
/data/user_de/0/androidx.test.orchestrator/files/
In my case, it was simpler to just check Logcat, rather than listen to that recommendation
For others encountering this issue, as #antek pointed out the files might not be accessible on a non-rooted device. You might try using an emulator running a non-Google Play API where you can obtain a root shell.
adb root
adb shell
ls /data/data/androidx.test.orchestrator/files
Alternatively, you could try running the tests using the debugger.
I could not find the text file, but I was able to get logcat and view the fatal that caused the orchestrator to crash
first I clear the logcat
adb logcat -c
then I run the test, then I grab the logcat
adb logcat > ~/Desktop/logcat
then I open logcat file and search for string FATAL
I just did wipe data in Android studio for my emulator using Device manager.
Restarted the emulator and run the test works for me

Location for SSL debug logging in java

I am trying to debug a java application using property - System.setProperty("javax.net.debug", "ssl"); in my main class.
I see debug logs in console when I run application using Eclipse during development. However, when I try to run same application using webstart I am not able to see any debug logs in any directory so far.
Is there a specific location where this logs are stored during execution?
I also tried passing debug option to run the jar from command line as java -Djavax.net.debug=ssl -jar xyz.jar but still cannot find logs generated.
Can anyone please help me understand to obtain SSL debug logs for java application?
Thank you.
They aren't stored anywhere. They are printed to System.out or System.err.
In some cases, from command line you can write debug output directly into a file:
java -Djavax.net.debug=all -jar xyz.jar > out.log

Unable to run a test from MTM - Config issue

I have set up a Test Controller and Test Agent running in separate machines and they are able to communicate with each other.
When I try to run the test from MTM (Selenium Tests), the test failed with the below error message
(QTController.exe, PID 1104, Thread 15) Could not use lab service account to access the build directory.
Failure: Network path does not exist or is not accesible using following user:
https://mydevelopment.visualstudio.com/defaultcollection/c2f372df-8c45-487a-9b51-4ced6e8f6037/_apis/build/builds/969/artifacts?artifactName=drop&%24format=zip
using MYDEV\timothy.alex. Error Code: 67
(QTController.exe, PID 1104, Thread 15) TcmRunner: Error starting the test run: The build directory of the test run either does not exist or access permission is required..
This clearly mentions that the error is because of access issue. But when I try downloading the build from the url mentioned in the error log using the same credentials mentioned in the ERROR log, I am able to download the drop zip file.
Is there any thing I am missing in the set up. Any help would be really really great.
It looks like you're using the new task-based build system. You can't run automated tests from a task-based build from MTM at present -- you have to use the older XAML build system for that.

Run a project from jetty in intellij with run time info outputted to a file

I have the following scenario:
I run my application in development mode and use jetty as the web server.Maven is used to build the application. Is it possible to output the run time log to a file instead of in the IntelliJ environment ?That is instead of viewing the information in the window with the red arrow pointing towards it I want to display it in a file.
You have a Logs tab in Jetty Server running configuration where you can choose to save console output to a file.

Jenkins stops at Launching Internet Explorer

we are using Jenkins as CI in our project. We were running the CI from the command line using the following command
java -jar C:\\jenkins\\jenkins.war --httpPort=8085 --ajp13Port=8009
As the system needs to restart frequently, we change CI to start as a windows service.
Now we are facing the issues for Selenium test cases. Selenium test cases are not running after we make Jenkins as service. We are getting the following log and no more progress from that point
18:36:30,718 INFO [org.openqa.selenium.server.SeleniumDriverResourceHandler] Command request: getNewBrowserSession[*iexploreproxy, http://192.168.132.105:8080/, ] on session null
18:36:30,718 INFO [org.openqa.selenium.server.BrowserSessionFactory] creating new remote session
18:36:30,796 INFO [org.openqa.selenium.server.BrowserSessionFactory] Allocated session 80b95d0273ac4ea4a82860c79438f071 for http://192.168.132.105:8080/, launching...
18:36:30,796 INFO [org.openqa.selenium.server.browserlaunchers.WindowsProxyManager] Modifying registry settings...
18:36:31,781 INFO [org.openqa.selenium.server.browserlaunchers.InternetExplorerCustomProxyLauncher] Launching Internet Explorer...
Per hudson wiki, you should be running Hudson (or jenkins) as tasks rather than service for GUI testing. Check here. Look at the section GUI Testing in Windows
Following changes will resolve the problem
Update the selenium version.
Use *iexploreproxy or *piiexplore for IE instead of *iehta/*iexplore