1 - Message "Please set […] in .greenspector/config.yml"
Problem
Message :
Please set the application name in .greenspector/config.yml to use this feature
Please set the version in .greenspector/config.yml to use this feature
This message appears if the file .greenspector/config.yml is not complete to use this feature.
Solution
Complete the file .greenspector/config.yml with the missing information by looking at the CLI usage section.
2 - http_request module installation
If you activated the http_request module, it’s possible you encounter an error of this kind.
INFO[2016-09-08T08:06:42+02:00] Phantomas - isPhantomasInstalled ERRO[2016-09-08T08:06:42+02:00] Phantomas command execution failed: fork/exec : no such file or directory INFO[2016-09-08T08:06:42+02:00] Phantomas - Install npm WARN deprecated tough-cookie@2.2.2: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130 INFO[2016-09-08T08:07:53+02:00] Phantomas - Launch http://www.greenit.fr ERRO[2016-09-08T08:07:53+02:00] Phantomas command execution failed: fork/exec : no such file or directory ERRO[2016-09-08T08:07:53+02:00] Error while launching phantomas: fork/exec : no such file or directory
It happens because you activated the module but the phantomas dependency is not installed. The Testrunner is doing this for you but you still need NPM (Node Package Manager) installed on your computer.
From here, you need to add Phantomas Path and version in your config.yml, then relaunch the Testrunner.
3 - Measure results are not sent to the server
Problem
Results are not displayed on the web interface after measures have been run.
Solution
Verify the logcat of the android device with the tag GSPT:
logcat
adb logcat | grep GSPT
These logs may give relevant information if a problem occurred during the measure.
Verify permissions are properly set up in your application manifest:
AndroidManifest.xml
<uses-permission android:name="android.permission.INTERNET" />
If not set, the application cannot access the Internet and thus send results to your GREENSPECTOR instance.
In your browser, https://your-instance.greenspector.com/api must return OK.
If your measures were run using the Test Runner, verify that your measures were not done in offline mode by checking your .greenspectorconf.json file. In that case, simply fix your configuration. Moreover, you can send your previous measurement results using the CLI.
4 - Unauthorized return with CLI
Problem
Error: Unauthorized. Your token may be invalid. Please check your configuration file.
Reason
This message appears when you are trying to use a feature that requires connection and your private token is not valid.
Solution
Verify your token and server address in
[USER HOME]/.greenspector/config.yml
Check your connection using the command
gspt ping
.
5 - Bash compatibility on Windows
The PC-Launcher used by the Testrunner to measure Websites on PC relies on Bash.exe. We support the Git Bash Implementation provided by Git for Windows. If you use another Bash implementation, you may encounter some issues while measuring a Website. which are, the browser getting stuck for more than a minute on a blank page with URL field set as "data;" and the Testrunner stuck on the following
INFO[2016-09-12T17:51:08+02:00] Loading url in browser http://www.greenspector.com/ chrome INFO[2016-09-12T17:51:08+02:00] Measuring...
If that’s the case, please ensure you are compliant with our requirements and update your Bash implementation.
6 - "Command not found" when I run CLI
Problem
When I try to run the CLI , I get a command not found
error.
Solution
If the gspt
command is not found by your system, check if the path to the GREENSPECTOR Command Line executable file is in the $PATH
.
7 - Chromedriver issue on Windows
While doing website measures on Windows, chromedriver processes may stay open and accumulate after the Testrunner exited and disturb further use. You may need to kill those processes.
8 - Firefox browser is not supported for standard URL jobs on mobile
When launching a standard URL job on mobile with the Test Runner, only Chrome browser is supported. If you set Firefox browser in the job configuration file, the Test Runner may not fail with an error indicating that the browser is not supported.
9 - Meter compatibility with Windows
Meter tools running on PCs or servers (Meter API Java and JS, Meter Standalone, TestRunner, Plugin JMeter) can be used:
in local mode on Mac OS, Windows or Linux;
in distant mode (via SSH) from a Mac OS or Linux-based PC to a Linux-based server.
They are not validated in distant mode (via SSH) from a Windows-based PC to a Linux- or Windows-based server.
10 - Ping command of CLI doesn’t function
It's likely that your network requires a proxy to access the Internet. For example, it may work at home, but not at the office. To make sure it's your corporate network that's doing the blocking, you can do a connection share with your phone so that your PC no longer uses your office network, and re-run the 'gspt ping' command. If the ping command still doesn't work, the problem is elsewhere. If the ping command works, you'll need to configure the CLI with the proxy.
The documentation to configurate the proxy for the CLI is here : https://greenspectorstudio.atlassian.net/wiki/pages/createpage.action?spaceKey=DOCUMENTATION&title=CLI in “Optional proxy configuration” part.
11 - Testrunner Read error for GDSL file : EACCES (Permission denied)
Example :
java.lang.Exception: Error reading test file /sdcard/greenspector/testssuites/suite1/script.testgb
Caused by: java.io.FileNotFoundException: /sdcard/greenspector/testssuites/suite1/script.testgb open failed: EACCES (Permission denied)
Caused by: android.system.ErrnoException: open failed: EACCES (Permission denied)
On some phones, the Greenspector application does not acquire the correct rights to read files from the sdcard or the Greenspector application has lost its rights.
To solve this problem, try to use the command :
testrunner cleandevice
Then launch your test.
If you have the same problem, go to the phone in settings / apps, choose the Greenspector application, in Permissions / Files and media, choose 'Allow management of all files'. Do the same for the application com.greenspector.testbench.launcher.android.test
12 - Test results passed but I think the test didn't run
On rooted device (like s9 on our TestBench), you can’t pass spaces in extras parameters values.
In the example bellow, you need to remove spaces in extra parameter QUESTION1
when you run Greenspector CLI
./gspt testbench custom-tests --testsSuite launch:./script.testgb --monitoredPackage "com.android.chrome" -e QUESTION1="How can I reduce the environmental impacts of my website? "
In the example bellow, you need to remove spaces in extra parameter step1
in job.yml when you run Test Runner
# Testrunner job configuration file mode: custom # apk | url | custom greenspector: application: name: Myapp # Your application's name version: "1" # Your application's version job: # Custom job android apk testsSuites: - name: suite1 testFiles: - "../dsl/testdsl.testgb" monitoredPackages: - com.android.chrome # The package to monitor, existing or newly installed iterations: 1 # Number of iteration for each test case extras: config-screenbrightness: "127" step1: "step1 with space" #space do not work on rooted device config-skipsetupphone: "false" testTimeout: 30m0s # Timeout for the total duration of the test, default value is 30m, max value is 60m online: true # [true, false] networkMode: WIFI modules: android_system_monitoring: false tcpdump: false
13 - CLI (gspt) error when using a '!' in the terminal
In bash, the ! is interpreted. For example the command ‘!u' attempts to execute your last command starting with u. When using the CLI, if you must use a ‘!’ in your additional parameter you need to escape it with '\’.
gspt testbench custom-tests --testsSuite launch:./script.testgb --monitoredPackage "com.android.chrome" --iterations=1 -e PAUSEDURATION=30000 -e PAUSEAFTERLOAD=1000 -e PSWD="onepassword\!"
14 - Website GDSL tests behavior may differ between local device and Test Bench device
When automating your user journey, sometimes a GDSL test will pass on a local device and fail on a Test Bench device or vice versa. Test results may show that there are differences in the dump, the text may be found in the Test Bench device dump and not in a local device dump.
This behavior probably comes from the fact that the local device and the Test Bench device do not have the same Chrome version. Please install chrome 110 on local device https://greenspector.atlassian.net/wiki/spaces/DOCUMENTATION/pages/3121184771
15 - Test Runner erreur DELETE_FAILED_INTERNAL_ERROR
lors de la désinstallation de com.greenspector.testbench.launcher.android
WARN[2024-09-16T11:14:05+02:00] Could not reinstall the APK correctly. Will uninstall first... INFO[2024-09-16T11:14:05+02:00] ADB - Uninstall com.greenspector.testbench.launcher.android ERRO[2024-09-16T11:14:06+02:00] could not uninstall apk: Error: Exit code error: 1 - Command: adb -P' '5037' '-s' '68ce37c6' 'uninstall' 'com.greenspector.testbench.launcher.android - Stderr: Stdout: Failure [DELETE_FAILED_INTERNAL_ERROR]
Si vous avez cette erreur au lancement d’un test avec le TestRunner, merci de nettoyer les composants installés sur votre téléphone avec la commande suivante
testrunner -c config.yml cleandevice
Puis vous pouvez relancer votre test