Testlink: Getting 500 internal server error on importing test cases - testlink

I am trying to import test cases from XML file, but getting below error in the browser console.
"Failed to load resource: the server responded with a status of 500
(Internal Server Error)" in file "/lib/testcases/tcImport.php"

In testlink server, administrator need to install php-xml module for import xml files.
Check for Error logs in testlink server, following error is displayed when user try to import xml without php-xml module.
[php7:error] [pid 12367] [client XXX.XXX.XXX.XXX:40469] PHP Fatal error: Uncaught Error: Call to undefined function simplexml_load_string() in /var/www/html/lib/functions/xml.inc.php:35\nStack trace:\n#0 /var/www/html/lib/testcases/tcImport.php(553): simplexml_load_file_wrapper('/var/www/html/g...')\n#1 /var/www/html/lib/testcases/tcImport.php(56): check_xml_tc_tsuite('/var/www/html/g...', '0')\n#2 {main}\n thrown in /var/www/html/lib/functions/xml.inc.php on line 35, referer: https://testlink.xxxxx.com/lib/testcases/tcImport.php?containerID=535

Related

selenium.common.exceptions.WebDriverException: Message: connection refused while launching Firefox browser through Selenium and Python

I am trying this code:
from selenium import webdriver
browser = webdriver.Firefox()
browser.get('http://seleniumhq.org/')
It opens firefox but does not get the link and shows this message:
Traceback (most recent call last):
File "new.py", line 3, in <module>
browser = webdriver.Firefox()
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/webdriver.py", line 170, in __init__
keep_alive=True)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 156, in __init__
self.start_session(capabilities, browser_profile)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 245, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 314, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: connection refused
Configuration:
selenium latest version
browser latest version
python 2.7.14
os:kali linux 2.0
geckodriver log:
1527001787163 geckodriver INFO geckodriver 0.20.1
1527001787169 geckodriver INFO Listening on 127.0.0.1:51383
1527001788204 mozrunner::runner INFO Running command: "/usr/bin/firefox" "-marionette" "-profile" "/tmp/rust_mozprofile.IKjgvyUQaThG"
1527001790297 Marionette INFO Listening on port 2828
[
This error message...
selenium.common.exceptions.WebDriverException: Message: connection refused
...implies that WebDriverException which is the base webdriver exception was raised as the driver failed to start its internal server to communicate with the python client.
Though you mentioned about selenium latest version and browser latest version, the exact details would have helped us to diagnose the issue in a much easier way.
Again, though you mentioned the message but I don't see any error in geckodriver log.
Try the following steps :
Pass the Key executable_path along with the Value referring to the absolute path of the GeckoDriver as follows :
from selenium import webdriver
browser = webdriver.Firefox(executable_path='/path/to/geckodriver')
browser.get('http://seleniumhq.org/')
Upgrade Selenium to current levels Version 3.12.0.
Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
Use CCleaner tool to wipe off all the OS chores before and after the execution of your Test Suite.
If your base Web Client version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of Web Client.
Take a System Reboot.
Execute your #Test.
Presumably, there was an instance of GeckoDriver and Firefox Browser Client active previously, so always invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.
You can find a detailed discussion in:
How to fix “WebDriverException: Message: connection refused”?
Selenium Python selenium.common.exceptions.WebDriverException: Message: connection refused using geckodriver and firefox
You can try this code :
from selenium import webdriver
driver = webdriver.Firefox(executable_path = r'you web driver full path')
driver.get("http://seleniumhq.org/")
You need to kill all firefox processes to release the resources.
Add this line to kill.sh
kill $(ps aux | awk '/firefox/ {print $2}')
run
sh kill.sh

RobotFrameWork:: Execution in Firefox throws keyError: 'Value" Error for every execution

Attached is the pkgs installed with our project setup..
and we cant upgrade our pkgs due to some reasons.
I tried to run the in these combinations FFv53,54,55,56 with gecko driver 16,19
This is the error message from PyCharm:
==============================================================================
[ WARN ] Keyword 'Capture Page Screenshot' could not be run on failure: No browser is open
Ping Endpoint2222 :: Sends and verifies a ping command for some en... | FAIL |
Setup failed:
KeyError: 'value'
------------------------------------------------------------------------------
Commands.Ping :: Ping Command | FAIL |
1 critical test, 0 passed, 1 failed
1 test total, 0 passed, 1 failed
==============================================================================
Geckodriver logs:
1510747591183 geckodriver INFO Listening on 127.0.0.1:65395
1510747593075 geckodriver::marionette INFO Starting browser \\?\D:\Program Files\firefox.exe with args ["-marionette"]
1510747594386 addons.manager DEBUG Application has been upgraded
1510747594387 addons.manager ERROR startup failed: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIFile.create]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame :: resource://gre/modules/FileUtils.jsm :: FileUtils_getDir :: line 70" data: no] Stack trace: FileUtils_getDir()#resource://gre/modules/FileUtils.jsm:70 < FileUtils_getFile()#resource://gre/modules/FileUtils.jsm:42 < validateBlocklist()#resource://gre/modules/AddonManager.jsm:671 < startup()#resource://gre/modules/AddonManager.jsm:834 < startup()#resource://gre/modules/AddonManager.jsm:3129 < observe()#resource://gre/components/addonManager.js:65
1510747594389 addons.manager DEBUG Completed startup sequence
JavaScript error: resource://gre/modules/AddonManager.jsm, line 1657: NS_ERROR_NOT_INITIALIZED: AddonManager is not initialized
*** Blocklist::_preloadBlocklistFile: blocklist is disabled
1510747598397 Marionette INFO Listening on port 65402
JavaScript error: resource://gre/modules/AddonManager.jsm, line 2570: NS_ERROR_NOT_INITIALIZED: AddonManager is not initialized
1510747598952 Marionette WARN TLS certificate errors will be ignored for this session
1510747658086 addons.productaddons INFO sending request to: https://aus5.mozilla.org/update/3/GMP/53.0/20170413192749/WINNT_x86_64-msvc-x64/en-US/release/Windows_NT%206.1.1.0%20(x64)/default/default/update.xml
1510747659578 addons.productaddons INFO Completed downloading document
1510747660101 addons.productaddons INFO downloadXHR File download. status=200
1510747660112 addons.productaddons INFO Downloaded file will be saved to C:\Users\bbanduch\AppData\Local\Temp\tmpaddon-6363aa
1510747663032 addons.productaddons INFO downloadXHR File download. status=200
1510747663036 addons.productaddons INFO Downloaded file will be saved to C:\Users\bbanduch\AppData\Local\Temp\tmpaddon-ce3de3
JavaScript error: resource://app/modules/WindowsJumpLists.jsm, line 403: NS_ERROR_FILE_NOT_FOUND: Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIJumpListShortcut.app]
JavaScript error: resource://app/modules/WindowsJumpLists.jsm, line 403: NS_ERROR_FILE_NOT_FOUND: Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIJumpListShortcut.app]
JavaScript error: resource://gre/modules/AddonManager.jsm, line 1416: NS_ERROR_NOT_INITIALIZED: AddonManager is not initialized
JavaScript error: resource://app/modules/WindowsJumpLists.jsm, line 403: NS_ERROR_FILE_NOT_FOUND: Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIJumpListShortcut.app]
JavaScript error: resource://app/modules/WindowsJumpLists.jsm, line 403: NS_ERROR_FILE_NOT_FOUND: Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIJumpListShortcut.app]
JavaScript error: resource://app/modules/WindowsJumpLists.jsm, line 403: NS_ERROR_FILE_NOT_FOUND: Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIJumpListShortcut.app]
JavaScript error: resource://app/modules/WindowsJumpLists.jsm, line 403: NS_ERROR_FILE_NOT_FOUND: Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIJumpListShortcut.app]
JavaScript error: resource://app/modules/WindowsJumpLists.jsm, line 403: NS_ERROR_FILE_NOT_FOUND: Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIJumpListShortcut.app]
JavaScript error: resource://app/modules/WindowsJumpLists.jsm, line 403: NS_ERROR_FILE_NOT_FOUND: Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIJumpListShortcut.app]
JavaScript error: resource://app/modules/WindowsJumpLists.jsm, line 403: NS_ERROR_FILE_NOT_FOUND: Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIJumpListShortcut.app]
app-system-defaults
1510747289405 DeferredSave.extensions.json DEBUG Starting timer
1510747289407 DeferredSave.extensions.json DEBUG Save changes
1510747289407 addons.xpi-utils DEBUG New add-on firefox#getpocket.com installed in app-system-defaults
1510747289413 DeferredSave.extensions.json DEBUG Save changes
1510747289413 addons.xpi-utils DEBUG New add-on webcompat#mozilla.org installed in app-system-defaults
1510747289417 DeferredSave.extensions.json DEBUG Save changes
1510747289421 addons.xpi-utils DEBUG New add-on {972ce4c6-7e08-4474-a285-3208198ce6fd} installed in app-global
1510747289425 DeferredSave.extensions.json DEBUG Save changes
1510747289425 addons.manager DEBUG Registering startup change 'installed' for aushelper#mozilla.org
1510747289432 addons.xpi DEBUG Loading bootstrap scope from D:\Program Files\browser\features\aushelper#mozilla.org.xpi
1510747289437 addons.xpi DEBUG Calling bootstrap method install on aushelper#mozilla.org version 2.0
1510747289437 addons.xpi-utils DEBUG Make addon app-system-defaults:aushelper#mozilla.org visible
1510747289437 DeferredSave.extensions.json DEBUG Save changes

error: [Errno 10060] A connection attempt failed when using solrpy in python

when i am trying to run the following python code which uses solrpy,
enter code here
import solr
s = solr.SolrConnection('http://example.org:8080/solr')
s.add(id=1, title='Lucene in Action', author=['hello','lucky'])
s.commit()
response = s.query('title:lucene')
for hit in response.results:
print hit['title']
i am getting the following error:
error: [Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
You should point to a valid Solr (are you sure there is a Solr running at example.org?)

Redirect stdout and stderr to file in Django with wsgi

I'm trying to make django work with wsgi in a shared hosting, so I cannot access server logs,
I'm trying to redirect the output to a file in my django.wsgi script, like this:
saveout = sys.stdout
log_out = open('out.log', 'w')
sys.stdout = log_out
but this is the error that I have (in the only error log that I can access)
[Thu Oct 07 19:18:08 2010] [error] [client <ip>] File "/home/myuser/public_html/django.wsgi", line 9, in <module>
[Thu Oct 07 19:18:08 2010] [error] [client <ip>] mod_wsgi (pid=30677): Exception occurred processing WSGI script '/home/myuser/public_html/django.wsgi'.
and that is all the error I can get
Line 9 is the one that tries to open file. I've tried creating previously the file, giving writing access to everyone, without the file previously created.. and nothing.
In the app, I only get a 500 server error.
Is there a proper way to get this output without access to apache logs?
Edited:
Using absolute paths, I can open files and write to them, but I get empty files unless I close the files in the end, is it necessary? Could I leave the files open?..
Regarding to the initial problem, even though I used exception handling, write a "finish ok" to file in the end of my script, then close the file, but still get the error:
[Thu Oct 07 13:33:07 2010] [error] [client <ip>] mod_wsgi (pid=32541): Exception occurred processing WSGI script '/home/myuser/public_html/django.wsgi'.
If I intentionally raise an error, it is logged in the file, so as i get "ok" I think the script worked fine but the result is still that message error... no clues
You can't use relative pathnames like out.log in a WSGI application. WSGI doesn't specify where the working directory will be pointing and mod_wsgi doesn't set it unless specifically asked to in daemon mode.
Use an absolute pathname based on your application's root. You can use os.path.dirname(__file__) to get the directory containing the current script/module if needed.

Unable to upload a Django project to Google App Engine

I am trying to test the codes of the project.
I run the following code
$appcfg.py update masicode/
I get the following error
Scanning files on local disk.
Initiating update.
2009-04-06 21:58:42,401 ERROR appcfg.py:1235 An unexpected error occurred. Aborting.
Traceback (most recent call last):
File "/Applications/Coding/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 1213, in DoUpload
missing_files = self.Begin()
File "/Applications/Coding/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 1009, in Begin
version=self.version, payload=self.config.ToYAML())
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appengine_rpc.py", line 303, in Send
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 380, in open
response = meth(req, response)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 491, in http_response
'http', request, response, code, msg, hdrs)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 418, in error
return self._call_chain(*args)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 353, in _call_chain
result = func(*args)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 499, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 403: Forbidden
Error 403: --- begin server output ---
You do not have permission to modify this app (app_id=u'so').
--- end server output ---
The contents of masicode
$ls masicode/
app.yaml index.yaml main.py
How can you upload Django project successfully to Google App Engine?
Looks like login/permissions problem.
HTTP Error 403: Forbidden
You do not have permission to modify this app (app_id=u'so').
Your appID should be same as the one you have registered in Google App Engine. Your mail and password same as credentials that you've used to register it.
Is http://so.appspot.com/ yours?
Further reading on deploying Django on App Engine:
Official Google's article Django on App Engine
Thomas Brox Røst "Django on Google App Engine in 13 simple steps"
Did you develop it specifically for App Engine using a modified Django library such as http://code.google.com/p/google-app-engine-django/? App Engine is a different environment than your standard Python install and apps that were not developed for it will not work (and possibly deploy) correctly.
Does the app run correctly in the App Engine development environment?