Error on jade invalid indentation; expecting 0 spaces - java

I am working in project which most of the code written by JADE technology.I am new bie to jade.I dont get any clue from the Error stack flow, I posted my jade code and error below ,please share your suggestion's what I am wrote wrong and where do I make a change?
.row
.col-md-12
.panel.panel-primary
.panel-heading
h3 {{cc.header.subject}}
ep-editable-date-time(model='cc.header')
.panel-body
.panel.panel-default(ng-repeat='step in cc.checklist.steps',
data-step='{{step.stepPath[step.stepPath.length - 1].name}}')
.panel-heading
span.pull-right.checklist-controls(ng-if='cc.checkupType !== cc.types.DRIVEBY')
button.btn(ng-class="{'active': !step.skip, 'btn-default': step.skip, 'btn-success':!step.skip}",
ng-click='step.skip=!step.skip; step.skip ? step.noSelfCheckNeeded=true : noop')
span Include
=" "
span.fa(ng-class="{'fa-square-o': step.skip, 'fa-check-square-o': !step.skip}")
=" "
span(ng-if='cc.checkupType === cc.types.SUPERVISOR')
button.btn(ng-class="{'active': !step.noSelfCheckNeeded, 'btn-success': !step.noSelfCheckNeeded, 'btn-default':step.noSelfCheckNeeded}",
ng-click='step.noSelfCheckNeeded=!step.noSelfCheckNeeded',
ng-disabled='step.skip')
span Self Check
=" "
span.fa(ng-class="{'fa-check-square-o':!step.noSelfCheckNeeded, 'fa-square-o': step.noSelfCheckNeeded}")
h5.checklist-header(ng-bind='step.process.name')
h6
span(ng-repeat='s in step.stepPath')
span(ng-bind='s.name')
span(ng-show='!$last')
=" > "
table.table
col
col(style='width: 60px')
thead
tr
th(colspan='2', style='text-align: right') In compliance?
th(style='width: 100px') Not-Applicable
tbody
tr(ng-repeat='b in step.behaviors')
td(ng-bind='b.name')
td
span.bigcheck.compliance-checkbox
label.bigcheck
input.bigcheck(type='checkbox', ng-model='b.compliance', ng-disabled='step.skip')
span.bigcheck-target
//I added these lines which started and ended with ** , It makes me a trouble please guided any one what I have missed .,
**td
span.bigcheck.compliance-checkbox
label.bigcheck
input.bigcheck(type='checkbox', ng-model='b.compliance', ng-disabled='step.skip')
span.bigcheck-target**
.panel-footer
div(ng-if='cc.checkupType === cc.types.SUPERVISOR', style='text-align: center')
span(ng-if='!cc.selfCheckupNeeded()')
h6(ng-if='cc.anyStepsSelected()') Save and Return to Subject Dashboard
h6(ng-if='!cc.anyStepsSelected()') Include at least one Step before saving Checkups
button.btn.btn-success(ng-if='!cc.selfCheckupNeeded()',
ng-disabled='!cc.isCheckupDTValid() || !cc.anyStepsSelected()',
ng-click='cc.saveAndDontSelfCheckup()') Save Supervisor Checkup
span(ng-if='cc.selfCheckupNeeded()')
h6 Save and Start Self Checkup
button.btn.btn-primary.self-checkup-now-btn(ng-disabled='!cc.isCheckupDTValid()',
ng-click='cc.saveAndStartSelfCheckup()')
span.fa.fa-check-square-o
| Self Checkup Now
=" "
button.btn.btn-danger.self-checkup-later-btn(ng-disabled='!cc.isCheckupDTValid()', ng-click='cc.saveAndSelfCheckupLater()')
span.fa.fa-check-square-o
| Self Checkup Later
div(ng-if='cc.checkupType === cc.types.SELF', style='text-align: center')
h6 Save and View Results
button.btn.btn-success.save-self-checkup(ng-disabled='!cc.isCheckupDTValid()',
ng-click='cc.saveAndDontSelfCheckup()')
span.fa.fa-check-square-o
| Save Self Checkup
div(ng-if='cc.checkupType === cc.types.DRIVEBY', style='text-align: center')
h6 Save Checkup
button.btn.btn-success(ng-disabled='!cc.isCheckupDTValid()', ng-click='cc.saveAndDontSelfCheckup()')
span.fa.fa-check-square-o
| Save Checkup
Error stack flow
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is class de.neuland.jade4j.exceptions.JadeLexerException checkup/checklist.jade:42
invalid indentation; expecting 0 spaces
Caused by: de.neuland.jade4j.exceptions.JadeLexerException: invalid indentation; expecting 0 spaces

The edited code above works fine with jade node module.
You should doublecheck such issues just by pasting your template at jade-lang.com
(Your template works fine there also)
As robertklep mentioned, it is likely an issue with your lexer

Related

Newline in datatable Gherkin/Cucumber

I have this datatable in my cucumber scenario:
| name | value
| Description | one \n two \n three |
I want the values to appear in the textarea like this:
one
two
three
Because I need to make bullet points out of them.
So my actual question is, is it possible to use newline characters in one line or is there a better way to approach this?
EDIT: to clarify, it's not working with the code written above:
WebDriverException: unknown error: Runtime. evaluate threw exception: SyntaxError: Invalid or unexpected token
EDIT 2: I'm using a bit of unusual code to access the value, seeing as it is a p element and this is normally not possible:
js.executeScript("document.getElementsByTagName('p')[0].innerHTML = ' " + row.get("value") + " ' ");
This has been working for other rows tho, maybe because i'm using \n now?
You can try this way:
WebDriver driver = new ChromeDriver();
driver.get("https://stackoverflow.com/questions/51786797/newline-in-datatable-gherkin-cucumber/51787544#51787544");
Thread.sleep(3000); // pause to wait until page loads
String s = "SOME<br>WORDS";
JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("document.getElementsByTagName('div')[0].innerHTML = '" + s + "';");
Output:
SOME
WORDS
So, main idea is to use <br> tag as new line separator.
In your case it would be like this:
| name | value
| Description | one<br>two<br>three |
and code would be:
// make sure, that row.get("value") returns a string
js.executeScript("document.getElementsByTagName('p')[0].innerHTML = ' " + row.get("value") + " ' ");

Selenium xpath for complex dynamic span

For complex site that has a step hierarchical structure (Region-Site-Zone-ZoneID), I'm trying to build a dynamic xpath for counting ZoneID (1..10)
Structure
<div class="aic-tree-branch-content VAD2" ng-click="events.selectZone(site.id, zone.id)">
<span class="new-sprite unimported selected" ng-class="{'imported': zone.zoneImported, 'unimported': !zone.zoneImported, 'selected': zone.zoneName === selecteds.zone}"></span>
<span class="aic-tree-branch-content-name ng-binding" ng-bind-html="zone.zoneName | highlightFilter: model.searchTerm" ng-click="ui.selectTreeNode(zone.zoneName, 'zone')">VAD2</span>
<span class="aic-tree-branch-content-type zone-type ng-binding" ng-bind="'('+zone.designTypeName+')'">(M)</span>
<span class="aic-tree-branch-content-icon new-sprite zone-state in-creation-small" ng-class="ui.getZoneStatusIcon(zone.zoneState, zone.zonePhase)"></span>
</div>
Code
public static void refreshAndOpenMultiZones(WebDriver driver, String SiteName, String zoneName) throws Exception {
driver.navigate().refresh();
for (int num=1; num<3; num++) {
logger.info("Open existing zone: " + SiteName + num + " in North America");
//Select desired zone in site
By ByZoneName = By.xpath("//span[.='"+zoneName+"']");
logger.info("Select Zone: "+ zoneName);
Utils.wait(5);
driver.findElement(ByZoneName).click();
logger.info("Wait for page to be loaded");
GeneralUtils.waitForElevationPage(driver, timeOutSec);
}
}
The problem: How to combine the code line
By ByZoneName = By.xpath("//span[.='"+zoneName+"']");
for dynamic zoneName id (for the same execution VAD1, VAD2, VAD3.... VAD10)
Actual:
This structure is executed correctly for zoneName=VAD1 and after this in the second curcle is failed with Exception
--- Unable to locate element: {"method":"xpath","selector":"//span[.'VAD']"}
Question:
How to create dynamic structure for xpath with zoneName?
i.e.
By ByZoneName = By.xpath("//span[.='"+zoneName.lastIndexOf(num)+"']");
is failed with Exception
Unable to locate element: {"method":"xpath","selector":"//span[.='-1']"}
Inside your loop you need to either initially establish the web page or alternatively, navigate BACK to that original page at the end of the loop before attempting to locate and click another web element.
It cannot locate the next zone because the page is not the same.

Read TeamSpeak 3 Messages with java

im wondering if there is any other way to read out the TeamSpeak Channel Chat with java.
I know that you could use a lua plugin which opens tha java program with the messages as parameter.
The code for the Lua Plugin's event.lua file: (could be outdated)
local function onTextMessageEvent(serverConnectionHandlerID, targetMode, toID, fromID, fromName, fromUniqueIdentifier, message, ffIgnored)
print("Testmodule: onTextMessageEvent: " .. serverConnectionHandlerID .. " " .. targetMode .. " " .. toID .. " " .. fromID .. " " .. fromName .. " " .. fromUniqueIdentifier .. " " .. message .. " " .. ffIgnored)
if targetMode == 2 then
os.execute("Program.exe " .. '"' .. message .. '"')
if message == "!command#1" or message == "!command#2" or message == "!command#3" then
folder = os.getenv("APPDATA")
file = io.open(folder .. "/" .. "tmp.txt", "r")
tempfile = file:read("*all")
file:close()
os.remove(folder .. "/" .. "tmp.txt")
ts3.requestSendChannelTextMsg(serverConnectionHandlerID, tempfile, fromID)
end
end
return 0
end
Basicly the Program.exe creates the tmp.txt file and writes the specified (inside the Program.exe) answer to the file which is sent to the chat by the lua plugin.
Now i want to know if there is any way to get the messages directly with java (so that the lua plugin isn't needed anymore)
I'm thankful for any help
I found out that you can simply scan the channel & server chatlogs for new entrys.
The Logs can be found here:
%APPDATA%\Roaming\TS3Client\chats\<UniqueServerID>
Unfortunately i have no idea how the UniqueServerID is generated and where the private chatlogs can be found.

Exception in EDI Stream to Java Object conversion

I am trying to read an EDI Message and converting it to Java object ,but I am ended with below exception .
Exception in thread "main" org.milyn.SmooksException: Failed to filter
source. at
org.milyn.delivery.sax.SmooksSAXFilter.doFilter(SmooksSAXFilter.java:97)
at
org.milyn.delivery.sax.SmooksSAXFilter.doFilter(SmooksSAXFilter.java:64)
at org.milyn.Smooks._filter(Smooks.java:526) at
org.milyn.Smooks.filterSource(Smooks.java:482) at
org.milyn.Smooks.filterSource(Smooks.java:456) at
org.milyn.edi.unedifact.d97a.D97AInterchangeFactory.fromUNEdifact(D97AInterchangeFactory.java:58)
at
org.milyn.edi.unedifact.d97a.D97AInterchangeFactory.fromUNEdifact(D97AInterchangeFactory.java:40)
at com.ibm.gpohub.edi.common.SmooksSample.main(SmooksSample.java:18)
Caused by: org.milyn.edisax.EDIParseException: EDI message processing
failed [ORDRSP][D:97A:UN]. Segment [FTX], field 4 (TEXT_LITERAL),
component 1 (Free_text_-_-1) expected to contain a value. Currently
at segment number 6. at
org.milyn.edisax.EDIParser.mapComponent(EDIParser.java:687) at
org.milyn.edisax.EDIParser.mapField(EDIParser.java:636) at
org.milyn.edisax.EDIParser.mapFields(EDIParser.java:606) at
org.milyn.edisax.EDIParser.mapSegment(EDIParser.java:564) at
org.milyn.edisax.EDIParser.mapSegments(EDIParser.java:535) at
org.milyn.edisax.EDIParser.mapSegments(EDIParser.java:453) at
org.milyn.edisax.EDIParser.parse(EDIParser.java:428) at
org.milyn.edisax.EDIParser.parse(EDIParser.java:410) at
org.milyn.edisax.unedifact.handlers.UNHHandler.process(UNHHandler.java:97)
at
org.milyn.edisax.unedifact.handlers.UNGHandler.process(UNGHandler.java:58)
at
org.milyn.edisax.unedifact.handlers.UNBHandler.process(UNBHandler.java:75)
at
org.milyn.edisax.unedifact.UNEdifactInterchangeParser.parse(UNEdifactInterchangeParser.java:113)
at
org.milyn.smooks.edi.unedifact.UNEdifactReader.parse(UNEdifactReader.java:75)
at org.milyn.delivery.sax.SAXParser.parse(SAXParser.java:76) at
org.milyn.delivery.sax.SmooksSAXFilter.doFilter(SmooksSAXFilter.java:86)
... 7 more
Here is the code snippet:
D97AInterchangeFactory d97InterChangeFactory = (D97AInterchangeFactory)SmooksFactoryImpl.D97A_FACTORY.getInstance();
InputStream ediSource = new FileInputStream("C:\\EDIFACT_MSG.txt");
UNEdifactInterchange interchange = d97InterChangeFactory.fromUNEdifact(ediSource);
if(interchange instanceof UNEdifactInterchange41){
List<UNEdifactMessage41> messages = ((UNEdifactInterchange41) interchange).getMessages();
for(UNEdifactMessage41 msg:messages){
System.out.println(msg.toString());
}
}
EDIMessage :
UNA:+.?
UNB+UNOC:3+662424795TEST:16+IBMEDIID:ZZ+160330:1416+IG-62779496
UNG+ORDRSP+662424795TEST:16+IBMEDIID:ZZ+160330:1420+FG-34160863+UN+D:97A
UNH+80534414+ORDRSP:D:97A:UN BGM+231+20160330+4
DTM+69:20150501150000UTC?+12:304 FTX+SSR+++:Blank FTX+AAR++ST
FTX+COI+++CLW FTX+PRI++8 FTX+DEL++06 FTX+CUR+++Pack all item into one
box FTX+DIN+++make a call to customer before delivery
FTX+PRD+++1:1:PC01 FTX+AAP+++900:accept RFF+PC:20AMS67000
RFF+SE:PC01K33E RFF+SZ:ND RFF+ABO:Y RFF+CO:IBM1234501
DTM+4:20150501010101UTC?+12:304 RFF+ACW:CASE_12345 RFF+ADG:Y RFF+ACH:Y
RFF+ZOD:order_desk01 RFF+ZSD:IBM RFF+ZPD:30006672 RFF+ZCS:Blank
RFF+ZZZ NAD+SE+30001234++IBM NAD+BY+US00000001++Coca Cola:CA+9/F:841
WEBSTER ST:stress 3:Blank+SAN FRANCISCO++94117+US CTA+PD+:Jordan
Surzyn COM+Minako#DHL.com:EM COM+6508624654:TE NAD+OY+US00000001++IBM
Field Service:CA+9/F:900 WEBSTER ST:stress 3:Blank+SAN
FRANCISCO++94117+US CTA+CR+:Will Smith COM+Will#ibm.com:EM
COM+6508624654:TE LIN+10 PIA+5+04X6076 IMD+F++:::KEYBOARD NetVista
Keyboard (USB) QTY+21:1:EA DTM+69:20160610120000UTC?+12:304
FTX+OSI+++INW FTX+LIN+++ZSP1 FTX+AAP+++900:Accept FTX+ZCT+++STO from
DC to FSL RFF+ZSB:01 RFF+ZRO:Y RFF+ZOR:KEYBOARD in good condition
RFF+ZST:SOFT UNS+S UNT+50+80534414 UNE+1+FG-34160863 UNZ+1+IG-62779496
Can anyone guide me , where I am doing wrong ?
thanks in advance.
It was because of the improper EDIFACT message format. It is resolved after I got the proper EDIFACT message, as shown below. Hope any one faced similar issue may help this . --thanks
UNA:+.? '
UNB+UNOC:3+IBM:ZZZ+662424795TEST:16+160330:1416+00000016086706++++1'
UNG+ORDRSP+IBM:ZZZ+662424795TEST:16+160330:1420+00000000160867+UN+D:97A'
UNH+1+ORDRSP:D:97A:UN' BGM+231+20160330+4'
DTM+69:20160501150000UTC?+12:304' FTX+AAR++ER' FTX+SSR+++N:AM'
FTX+COI+++CLW' FTX+PRI++8' FTX+DEL++04' FTX+CUR+++Pack all item into
one box' FTX+DIN+++make a call to customer before delivery'
FTX+PRD+++IBMDECK001::PC01' FTX+AAP+++900:accept' RFF+PC:20AMS67000'
RFF+SE:PC01K33E' RFF+SZ:ND' RFF+ABO:N' RFF+CO:IBM1234501'
RFF+ACW:IBMCASE12301' DTM+4:20150501000000UTC?+12:304'
NAD+SE+30006672++3100001' NAD+BY+US00000001++CA:NEC Personal
Computers, Ltd.+9/F:841 WEBSTER ST:stress 3+SAN
FRANCISCO++941171717+US' CTA+PD+:Jordan Surzyn' COM+Minako#DHL.com:EM'
COM+6508624654:TE' NAD+OY+US00000001++CA:NEC Personal Computers,
Ltd.+9/F:841 WEBSTER ST:stress 3+SAN FRANCISCO++941171717+US'
CTA+CR+:Jordan Surzyn' COM+Minako#DHL.com:EM' COM+6508624654:TE'
LIN+20+++1:10' PIA+5+04X6076' IMD+F++:::KEYBOARD NetVista Keyboard
(USB)' QTY+21:1:EA' DTM+69:20160610120000UTC?+12:304' FTX+LIN+++ZSP1'
FTX+AAP+++900:Accpet' FTX+OSI+++INW' FTX+BSC+++KEYBOARD in good
condition' RFF+SE:Y' NAD+OY+01+SOFT' UNS+S' UNT+41+1'
UNE+1+00000000160867' UNZ+1+00000016086706'

How to send content of a file in a tSendMail

i try since some days to send one mail with different informations from child job and father job.
see my jobs below:
and my tRunJob_3
at the end of this job, i can put informations from tAggregateRow in the email, but it send several email (one mail by condition "if" approved DeinitJob --- if --- tRunJob_3)
my file generated by tFileOutputDelimited_1 in the father job contains all the information i need to put in the final mail.
1: how to display these informations in one email (no attachement) ?
2: i have this error in my console:
For input string: "7.91'7.91"
multiple points
what it means ?
EDIT:
with the modification below, it send me 1 email with the informations collected
in my tjavaflex:
code initial
// start part of your Java code
boolean loop ;
System.out.println("## START\n#");
code principal
// here is the main part of the component,
// a piece of code executed in the row
// loop
// code sample:
System.out.println("## LOAD...\n#");
if ((String)globalMap.get("message") != null) {
globalMap.put("message", (String)globalMap.get("message") + row5.mag + " qt: " + row5.qt + " p1: " + row5.p1 + "\n" ) ;
}
code final:
// end of the component, outside/closing the loop
loop = true ;
System.out.println("## END\n#");
with a if loop between tjava and tsendmail
but still have my error:
For input string: "7.91'7.91"
multiple points

Categories