Scheduled tasks invalid filter using XML - scheduled-tasks

I try to make a trigger using XML on the Window's task scheduler, but the tool tells me a filter is invalid and i was unable to find what is wrong.
My current XML is
<QueryList>
<Query Id="0" Path="Security">
<Select Path="Security">
*[System[Provider[#Name='Microsoft-Windows-Security-Auditing'] and (Level=4 or Level=0) and Task = 12801 and (EventID=4656) ]] and
*[EventData[Data[#Name='SubjectUserSid' and (Data='S-1-5-18')]] and
[Data[#Name='ObjectType' and (Data=Key) ]]]
</Select>
</Query>
</QueryList>
When I remove
and
[Data[#Name='ObjectType' and (Data=Key) ]]
The XML is accepted without error. As I don't understand what is wrong on my last line I'm stuck.

There are some missing closing square brackets around the SubjectUserSid and ObjectType attributes, the "*[EventData" missing from the last query line, and missing quotes around the Data value "Key". This works in my EventViewer:
<QueryList>
<Query Id="0" Path="Security">
<Select Path="Security">
*[System[Provider[#Name='Microsoft-Windows-Security-Auditing'] and (Level=4 or Level=0) and Task = 12801 and (EventID=4656) ]] and
*[EventData[Data[#Name='SubjectUserSid'] and (Data='S-1-5-18') ]] and
*[EventData[Data[#Name='ObjectType'] and (Data='Key') ]]
</Select>
</Query>
</QueryList>

Related

AutoHotKey: How to get list of available values from drop down list?

I am trying to automate a website to get data. Usually if I know in advance what are the possible value from the drop down list, I can hard code them in my script.
But if I don't know what are the values, is there an elegant way to dynamically obtain the drop down list values?
Working sample from: https://autohotkey.com/boards/viewtopic.php?t=15574
select name="ConnectDTO.EvaluationGroupId" id="ConnectDTO_EvaluationGroupId" style="width: 260px;" required="yes" data-val-number="The field Evaluation Group must be a number." data-val="true"><option value="">Please Select</option>
<option value="4">ccpdmanagement</option>
<option value="7">AM Northern</option>
<option selected="selected" value="3">cwplanning</option>
<option value="1">mnplanning</option>
<option value="2">msplanning</option>
<option value="9">LCC</option>
<option value="6">powerquality2</option>
<option value="8">AM Southern</option>
<option value="5">tcoqueries</option>
</select>
When my script arrived on the page after loadIE(wb), is there a way to "get" the list of selection - such as ccpdmanagement, AM Northern etc...?
I know how to select them once the option is known in advance only.
pwb.document.getElementById("ConnectDTO_EvaluationGroupId").Focus()
pwb.Document.GetelementById("ConnectDTO_EvaluationGroupId").value := "1"
Thanks.
I found a solution here: https://autohotkey.com/boards/viewtopic.php?t=35467
Althought the Author stated he has a problem with the code (stated not work for some reason).
But for my purpose - to retrieve the list of all the drop down list option. It worked fine.
myDropDownList := wb.document.getElementById("your_dropdown_ID")
loop % myDropDownList.length
{
test := myDropDownList[A_Index-1].value
MsgBox %test%
}

Populate and Update Form data in ColdFusion

I have a form the needs to be populated and and updated. There are several dropdown fields and input fields on the form that need to be populated and then allow the user to make a change if necessary. I have created queries to select the data, then I want to populate the form with the selected data but, allow a user to change the form fields. I have tried with the first field which is a dropdown field but, I receive an error saying that I can't nest two queries.
This is the error I received: A query driven cfoutput tag is nested inside a cfoutput tag that also has a query attribute. This is not allowed. Nesting these tags implies that you want to use grouped processing. However, only the top-level tag can specify the query that drives the processing.
Here is my code:
<cfoutput query="getinfo">
<select name="ProgramName" id="ProgramName" style= "font-size:24px">
<option style="font-size:24px" value = "0">--Program Name--</option>
<cfloop query="PName">
<option value="#ProgramName#">#ProgramName#</option>
</cfloop>
</select>
</cfoutput>
Here is my getinfo query:
<cfquery name="getinfo" datasource="dbotest">
SELECT ProgramName, TestName
FROM Programs
WHERE ProgramID = "D219"
</cfquery>
What you've posted is valid syntax for outputting a query.
<cfoutput query="getinfo">
<select name="ProgramName" id="ProgramName" style= "font-size:24px">
<option style="font-size:24px" value = "0">--Program Name--</option>
<cfloop query="PName">
<option value="#ProgramName#">#ProgramName#</option>
</cfloop>
</select>
</cfoutput>
If your page is set up like this, then that is invalid. You can simply change <cfoutput query="getinfo"> to be <cfloop query="getinfo">
<cfoutput>
<!--- other code --->
<cfloop query="getinfo">
<select name="ProgramName" id="ProgramName" style= "font-size:24px">
<option style="font-size:24px" value = "0">--Program Name--</option>
<cfloop query="PName">
<option value="#ProgramName#">#ProgramName#</option>
</cfloop>
</select>
</cfloop>
<!--- more code --->
</cfoutput>
(I know this isn't really an answer but should hopefully help clear things up.)

Capybara nested_form Poltergeist select action

I'm using the fantastic nested_form gem to handle my nested attributes which works perfectly.
My problem occurs when i try to use Capybara/rspec with Poltergeist as a driver to run a few integration tests on my nested form's select field.
My test is as follows.
click_on "Add Field"
find('input:last').set "Employee Code"
find('select:last').select "Word"
I get the following error in rspec
Failure/Error: find('select:last').select "Word"
Capybara::Poltergeist::ObsoleteNode:
Capybara::Poltergeist::ObsoleteNode
When i print the html content before trying to find 'select:last', I'm able to see the correct html. Pasted below.
<input class="string required" id="source_model_attributes_attributes_1355377152026_field_name" label="Field Name" name="source[model_attributes_attributes][1355377152026][field_name]" placeholder="Field Name" size="50" type="text">
<select class="select required" id="source_model_attributes_attributes_1355377152026_field_type" label="Field Type" name="source[model_attributes_attributes][1355377152026][field_type]" prompt="Select Field Type">
<option value="">Select Field Type</option>
<option value="Word">Word</option>
<option value="Number">Number</option>
<option value="True or False">True or False</option>
<option value="Date & Time">Date & Time</option>
<option value="Date">Date</option>
<option value="Time">Time</option></select>
I'm using find, instead of fill_in as my html is generated dynamically with a timestamp attached to the id & name fields.
It might also be worth mentioning that I've had poor luck with Capybara's select Action which I tried to use like this.
select "Word", from: "Field Type"
Which fails with the error below.
Failure/Error: select "Word", from: "Field Type"
Capybara::ElementNotFound:
cannot select option, no select box with id, name, or label 'Field Type' found
Capybara, for some reason, is not able to find the label, maybe because it's hidden from the actual form.

Printing object values in Spring jsp

I have a spring 3 application with select list.
<form:select path="objectlist" >
<c:forEach items="${objects}" var="objects">
<form:option value="${objects}" label="${objects.description}" >
</form:option>
</c:forEach>
</form:select>
There objects are queried from database. Path is Object class attribute.
I would like to print the description of an object user has chosen.
When I use ${form.objects} - I get an object instance written, but when adding .description there, it is null. What I'm missing here?
In <c:foreach> tag you should specify the variable where it will temporary store each array element. For some reason you are using same name as an array and at some point the two variables collide with each other.
Try this:
<c:forEach items="${objects}" var="object"> <%-- Notice there is no letter S at the end --%>
<form:option value="${objects}" label="${object.description}" > <%-- Here too --%>
</form:option>
</c:forEach>

cfselect problem

I theory seems to be the answer to the pre populated selectbox issue.
<cfselect name = "regions" query = "getRegions" selected="10" value="id" display="name" ></cfselect>
this is what it outouts
<option value="8">Dumfries & Galloway</option>
<option value="9">Dundee City</option>
<option value="10" selected="selected">East Ayrshire</option>
<option value="11">East Dunbartonshire</option>
but my option 10 is not selected automatically. The html looks ok any reason why?
Thanks,
R.
If you are using Firefox then that is probably the reason, because it keeps form values persistent across page reloads. You can use a different browser, or add something to the query string like ?abc=123.