Error from selenium IDE: The URI scheme corresponds to an unknown protocol handler - selenium-ide

I am quite new to selenium IDE.
I try to read from an XML file.
I saw the error on this site but it was not answered (It was stated that the error was with the xml file used, but that seems not to be the case)
The complete error I got is:
[error] Unexpected Exception: [Exception... "The URI scheme
corresponds to an unknown protocol handler" nsresult: "0x804b0012
(NS_ERROR_UNKNOWN_PROTOCOL)" location: "JS frame ::
chrome://selenium-ide/content/tools.js ->
file:///C:/Rommel/user-extensions.js?1447329745072 ::
IDEIncludeCommand.prototype.getIncludeDocumentBySynchronRequest ::
line 81" data: no]. toString -> function toString() { [native code] },
message -> , result -> 2152398866, name -> NS_ERROR_UNKNOWN_PROTOCOL,
filename -> chrome://selenium-ide/content/tools.js ->
file:///C:/Rommel/user-extensions.js?1447329745072, lineNumber -> 81,
columnNumber -> 0, inner -> null, data -> null, stack ->
IDEIncludeCommand.prototype.getIncludeDocumentBySynchronRequest#chrome://selenium-ide/content/tools.js
-> file:///C:/Rommel/user-extensions.js?1447329745072:81:5 xmlTestData.prototype.load#chrome://selenium-ide/content/tools.js ->
file:///C:/Rommel/datadriven.js?1447329745073:53:19
Selenium.prototype.doLoadTestData#chrome://selenium-ide/content/tools.js
-> file:///C:/Rommel/datadriven.js?1447329745073:102:2 fnBind/retval#chrome://selenium-ide/content/selenium-core/scripts/htmlutils.js:60:12
ActionHandler.prototype.execute#chrome://selenium-ide/content/selenium-core/scripts/selenium-commandhandlers.js:314:28
._executeCurrentCommand#chrome://selenium-ide/content/selenium-runner.js:306:19
TestLoop.prototype.resume#chrome://selenium-ide/content/selenium-core/scripts/selenium-executionloop.js:78:13
fnBind/retval#chrome://selenium-ide/content/selenium-core/scripts/htmlutils.js:60:12
, location -> JS frame :: chrome://selenium-ide/content/tools.js ->
file:///C:/Rommel/user-extensions.js?1447329745072 ::
IDEIncludeCommand.prototype.getIncludeDocumentBySynchronRequest ::
line 81
I got it with the selenium IDE command: loadTestData
<tr>
<td>loadTestData</td>
<td>C:\Rommel\test_data_file.xml</td>
<td></td>
</tr>
The XML file is this:
<testdata>
<test employee="1" type="1" startDate="01.01.2013" endDate="01.02.2013" />
<test employee="2" type="1" startDate="01.02.2013" endDate="01.03.2013" />
<test employee="3" type="1" startDate="01.03.2013" endDate="01.04.2013" />
</testdata>
I use the next user extension files:
sideflow.js, include.js, datadriven.js, goto_sel_ide.js.
Somewhere I read that the order of the extension files was important but changing the order did not solve the issue.
If I leave the filename blank the error persists, so my conclusion is that the error is not because of the content of the XML file.
I also tried to get the extension files form different sites, but they all seem to be the same.
Help would be very much appreciated.

Solved: after a day of frustration ... I needed to use the filepath: file:///C:/Rommel/test_data_file.xml
instead of
C:\Rommel\test_data_file.xml

Related

LB 4.1: uid is not installed

I am trying to use the unique id as described in the Reference Manual. However, I get the following error:
Error: P2PMapping defined at block_1Z1C1O1V:4(2)--7(73) requests module 'uid', but no module with that name is installed.
How do I install this module?
What is your program, exactly? I just tried the following lb script (which is a simplified version of the example from the manual):
create --unique
addblock <doc>
F[x] = id -> string(x), int(id).
R(x) -> string(x).
R("Joe").
R("Jill").
</doc>
exec <doc>
+F[x] = id <- uid<<id>> R(x).
</doc>
print F
close --destroy
The result is, as expected:
created workspace 'unique_workspace_2016-11-20-21-12-30'
added block 'block_1Z1B38XS'
"Jill" 10000000044
"Joe" 10000000046
deleted workspace 'unique_workspace_2016-11-20-21-12-30'

Errors in codeigniter-restserver library

I want to use restful in my ci 3.03 application:
I found this tutplus tutorial
I downloaded codeigniter-restserver-master.zip file and copied Format.php and REST_Controller.php(#version 3.0.0) files into /application/libraries/REST directory
I created control application/controllers/api/Users.php :
require_once("application/libraries/REST/REST_Controller.php");
require_once("application/libraries/REST/Format.php");
class Users extends REST_Controller
{
//protected $rest_format = 'json';
function users_get()
{
//$users = $this->user_model->get_all();
$filter_username= $this->get('filter_username');
$filter_user_group= $this->get('filter_user_group');
$filter_active= $this->get('filter_active');
$sort= $this->get('sort');
$sort_direction= $this->get('sort_direction');
//, $filter_user_group, $filter_active, $sort, $sort_direction
$users_list = $this->muser->getUsersList(false, ''/*, $filter_username, $filter_user_group, $filter_active, $sort, $sort_direction, ''*/);
echo '<pre>'.count($users_list).'::$users_lists::'.print_r($users_list,true).'</pre>';
if($users_list)
{
$this->response($users, 200);
}
else
{
$this->response(NULL, 404);
}
}
AND RUNNING URL http://local-ci3.com/api/users I got many errors:
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Users::$format
Filename: REST/REST_Controller.php
Line Number: 734
Backtrace:
File: /mnt/diskD_Work/wwwroot/ci3/application/libraries/REST/REST_Controller.php
Line: 734
Function: _error_handler
File: /mnt/diskD_Work/wwwroot/ci3/application/libraries/REST/REST_Controller.php
Line: 649
Function: response
File: /mnt/diskD_Work/wwwroot/ci3/index.php
Line: 292
Function: require_once
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Users::$format
Filename: REST/REST_Controller.php
Line Number: 752
Backtrace:
File: /mnt/diskD_Work/wwwroot/ci3/application/libraries/REST/REST_Controller.php
Line: 752
Function: _error_handler
File: /mnt/diskD_Work/wwwroot/ci3/application/libraries/REST/REST_Controller.php
Line: 649
Function: response
File: /mnt/diskD_Work/wwwroot/ci3/index.php
Line: 292
Function: require_once
Actually I wanted to get some workable library to help me with REST api creation. I think that is preferable way istead of making from zero.
But is this library not workable or does it needs for some fixing? Sorry, what I missed is if this library only for ci 2?
I made search on this forum and found such hint :
I have the same problem when I load both Format.php and
Rest_Controller.php into a controller. After have a quick glance at
Format.php, it appears to be a standalone format conversion helper.
Try to just load Rest_Controller.php and see if your problem goes
away.
I commented line
//require_once("application/libraries/REST/Format.php");
in my controller, but I still get errors like :
Message: Undefined property: Users::$format.
I tried to review code of this library and see that invalid block when data are converted to json format, line 731-757 :
elseif ($data !== NULL)
{
// If the format method exists, call and return the output in that format
if (method_exists($this->format, 'to_' . $this->response->format))
{
// Set the format header
$this->output->set_content_type($this->_supported_formats[$this->response->format], strtolower($this->config->item('charset')));
$output = $this->format->factory($data)->{'to_' . $this->response->format}();
// An array must be parsed as a string, so as not to cause an array to string error
// Json is the most appropriate form for such a datatype
if ($this->response->format === 'array')
{
$output = $this->format->factory($output)->{'to_json'}();
}
}
else
{
// If an array or object, then parse as a json, so as to be a 'string'
if (is_array($data) || is_object($data))
{
$data = $this->format->factory($data)->{'to_json'}();
}
// Format is not supported, so output the raw data as a string
$output = $data;
}
}
If I tried to commented this block, but get error
Message: Array to string conversion
Looks like data are not converted in this case...
Is is possible to fix these errors?
Or can you, please, to tell me advice some codeigniter 3 REST api workable library with similar interface like library above?
Thanks!
I use that lib, work just fine. My suggestion is follow the more relevant installation instruction on github .
you also wrong place the lib file :
Tutorial say :
require(APPPATH'.libraries/REST_Controller.php');
You try :
require_once("application/libraries/REST/REST_Controller.php");
require_once("application/libraries/REST/Format.php");
No need to include the format because on line 407 the lib will load it. And also good to know on line 404 it will load the configuration (application/config/rest.php) it will be your default configuration, and also you can change it to suit your need.
Please let me know if you still got error using my answer :)

CakePHP/CakeEmail - could not send EMAIL

I have function:
public function contact()
{
$dane = $this->data;
echo debug($dane);
$Email = new CakeEmail();
$Email->from(array(''.$this->data['kontakt']['email'].'' => 'Strefagospodarcza.pl'))
->to('contact#mysite.pl')
->subject(''.$this->data['kontakt']['temat'].'')
->send(''.$this->data['kontakt']['tresc'].'');
}
And beforeFunction in Controller
function beforeFilter(){
App::uses('CakeEmail', 'Network/Email');
$this->Auth->userModel = 'User';
$this->Auth->allow('register','login','step2','TakeId','znajdzUzytkownikow');
}
I have error:
Error: An Internal Error Has Occurred.
And this type of stack trace:
CORE\Cake\Network\Email\MailTransport.php line 47 → MailTransport->_mail(string, string, string, string, null)
CORE\Cake\Network\Email\CakeEmail.php line 1066 → MailTransport->send(CakeEmail)
APP\Controller\UsersController.php line 477 → CakeEmail->send(string)
[internal function] → UsersController->kontakt()
CORE\Cake\Controller\Controller.php line 486 → ReflectionMethod->invokeArgs(UsersController, array)
CORE\Cake\Routing\Dispatcher.php line 187 → Controller->invokeAction(CakeRequest)
CORE\Cake\Routing\Dispatcher.php line 162 → Dispatcher->_invoke(UsersController, CakeRequest, CakeResponse)
APP\webroot\index.php line 109 → Dispatcher->dispatch(CakeRequest, CakeResponse)
Where is mistake? I can not see it, for me all looks fine :)
change in app\Config\core.php
//from
Configure::write('debug', 1);
//to
Configure::write('debug', 2);
Then get full error message.
Try to avoid one line code is harder to debug when something goes wrong.
put
App::uses('CakeEmail', 'Network/Email');
inside contact function, that's might be the problem.
Powodzenia ;)
Are you doing this on local server like WAMP? If it is, then you will get this kinds of error. You need to setup your mail server if you wants to test it on local server.

casperjs scrape giving empty webpage response

I have written a script for CasperJS which is supposed to read a json file which has a list of sites with details on how to log into, and run the search pages for each keyword.
I have tested my code with one site which worked, however for the second site, it logs in but when it attempts to goto a search page it returns an empty page.
This is my casper setup:
casper = require('casper').create(
clientScripts: [
'jquery.min.js'
]
verbose: true
logLevel: "debug"
)
This is the loop code:
casper.start().each sites, (self, site)->
search_results[site.title] = {}
self.thenOpen site.login.path,
method: "get"
data: site.login.getdata
, ->
#echo "Visiting Login Page: #{site.login.path}"
self.then ->
self.then ->
#evaluate (ufield,user,pfield,pass)->
jQuery(ufield).val(user)
jQuery(pfield).val(pass)
,
ufield: site.login.form.username.element
user: site.login.form.username.value
pfield: site.login.form.password.element
pass: site.login.form.password.value
self.then ->
#echo "Added formdata"
self.then ->
#click "#{site.login.form.element} #{site.login.form.submit}"
self.then ->
#echo "Submitted form"
self.then ->
#waitUntilVisible site.login.form.wait.element, ->
#echo 'Page Loaded'
, ->
#echo "Login Failed"
#exit 1
, max_timeout
self.each keys, (self, skey)->
self.thenOpen site.search.path,
method: "get"
data: site.login.getdata
, ->
#echo "Visiting Search Page: #{site.search.path}, for #{skey}"
self.then ->
#echo #page.content
#waitUntilVisible "#{site.search.form.element} #{site.search.form.query.element}"
, ->
#echo "Search Form Visible"
, ->
#echo "Search Visit Failed"
#exit 1
, max_timeout
self.then ->
#evaluate (key, feild)->
jQuery(feild).val(key)
,
key: skey
feild: site.search.form.query.element
self.then ->
#echo "Added searchdata"
self.then ->
#click "#{site.search.form.element} #{site.search.form.submit}"
self.then ->
#echo "Submited Search"
self.then ->
#waitUntilVisible site.search.form.wait.element
, ->
#echo "Search Results Visible"
, ->
#echo "Search Failed"
#exit 1
, max_timeout
self.then ->
result_links = #evaluate (linktag)->
res = []
res_els = __utils__.findAll(linktag)
Array.prototype.forEach.call res_els, (e)->
href = e.getAttribute("href")
label = jQuery(e).text()
res.push {href: href, label: label} if href?
res
,
linktag: "#{site.search.threads.element} #{site.search.threads.link.element}"
self.then ->
utils.dump result_links
search_results[site.title][skey] = result_links
Console output to do with the fail is as follows:
[debug] [phantom] opening url: http://www.cyclingforums.com, HTTP GET
[debug] [phantom] Navigation requested: url=http://www.cyclingforums.com/, type=Other, lock=true, isMainFrame=true
[debug] [phantom] url changed to "http://www.cyclingforums.com/"
[debug] [phantom] Automatically injected jquery.min.js client side
[debug] [phantom] Successfully injected Casper client-side utilities
[info] [phantom] Step 50/68 http://www.cyclingforums.com/ (HTTP 200)
Visiting Search Page: http://www.cyclingforums.com, for track
[info] [phantom] Step 50/68: done in 63268ms.
[info] [phantom] Step 51/68 http://www.cyclingforums.com/ (HTTP 200)
<html><head></head><body></body></html>
[info] [phantom] Step 51/68: done in 63352ms.
[info] [phantom] Step 52/69 http://www.cyclingforums.com/ (HTTP 200)
[info] [phantom] Step 52/69: done in 63452ms.
[warning] [phantom] Casper.waitFor() timeout
Search Visit Failed
Why is the page responding with an empty page?
EDIT: Through testing with other sites, it seems that the base code works, but this one site seems to be causing issues.

lift net.liftweb.http.S#param doesnt works like wiki says

i try to copying the examples in wiki
http://wiki.liftweb.net/index.php/Hello_Darwin
in the example of HelloForm2.scala
"submit" -> submit(?("Send"), () => {println("value:" + who + " :: " + param("whoField"))}),
It always prints
value:Full(hogehoge) :: Empty" even if i set the who as "object who extends RequestVar(Full("world"))
am i do something wrong?
sorry for forgetting to post full code, i already try the second one in the wiki like below.
index.html
<lift:surround with="default" at="content">
<h2>Welcome to your project!</h2>
<lift:HelloWorld.show form="POST">
Hello <hello:who />
<br />
<label for="whoField">Who :</label>
<hello:whoField />
<hello:submit />
</lift:HelloWorld.show>
</lift:surround>
and HelloWorld.scala
class HelloWorld {
object who extends RequestVar(Full("world"));
def show(xhtml: NodeSeq): NodeSeq ={
bind("hello", xhtml,
"whoField" -> text(who.openOr(""), v => who(Full(v))) % ("size" -> "10") % ("id" -> "whoField"),
"submit" -> submit(?("Send"), () => {println("value:" + who.openOr("") + " :: " + param("whoField"))}),
"who" -> who.openOr("")
)
}
}
now, the who shows correct in the rendered page, but console still prints
value:hogehoge :: Empty
im using lift 1.0
thanks.
You have to change that code too, as shown in the example in the wiki page, which I'll copy here:
bind("hello", xhtml,
"whoField" -> text(who.openOr(""), v => who(Full(v))) % ("size" -> "10") % ("id" -> "whoField"),
"submit" -> submit(?("Send"), () => {println("value:" + who.openOr("") + " :: " + param("whoField"))}),
"who" -> who.openOr("")
)
Note that whoField is defined very differently.