chronoforms v5 multi file upload...cannot choose multiple files - file-upload

I am trying to configure this in v5 and cannot find any documentation. This is what I have so far...
followed the V4 documentation as close as possible, but cannot get the form to allow me to choose multiple files!
Under HTML Render I have Form Tag Attachment = enctype="multipart/form-data"
Under the designer tab I have file field element on the form. Under this I have
Field Name = file1[]
Field ID = file1
Multiple=Yes
Under the settings tab I have the files upload action in the on submit event. In the files upload action I have
Enabled=Yes
Files config = file1:jpg-png-gif-txt
Array fields = file1
is there anything else I need to do?

Turns out this is a bug and will be fixed in the next update. Workaround by creating a custom file upload element with the word multiple as a parameter.

Related

TestCafe does not write in text input field

I'm using TestCafe for test automation of a web application based on the Wicket framework. I try to type text into a text input field ... well, actually it is a dropdown list, where a text input field appears, so that the user can search for certain codes. The HTML fragment is as follows:
HTML fragment
And here is the corresponding screenshot (text field above "001"):
Text input field with dropdown
The user can type some characters and the list below is automatically filtered (I did this manually):
Text input field with some text
My TestCafe test tries this:
.click( productcodeList )
.expect( productcodeInputField.visible ).ok()
.click( productcodeInputField )
.typeText( productcodeInputField, 'ABW' )
i.e.
Click on the drop down list.
Assume that the text input field is now visible (works fine).
Click on the text input field (this should not be necessary, since typeText() is supposed to do this anyway).
Type the text "ABW" into the text input field ==> This does not work.
I'm sure that my Selector works, since the assertion (expect) is successful and when I debug the test run after the second click (on the text input field), I see the following:
TestCafe screenshot
I.e. the cursor is directly on the text field, but somehow TestCafe cannot write the text into the field.
Some additional information: The Selector for the input field is created as follows:
productcodeInputField = Selector('span').withAttribute('class', /select2-dropdown.*/ ).child('span').withAttribute('class', /select2-search.*/ ).child('input').withAttribute('class', 'select2-search__field' );
More information: I'm using the same logic on the same page:
kurzbezeichnungField = Selector('input').withAttribute('name', /.*aeAbbreviation.*/);
...
await t.click( kurzbezeichnungField )
.typeText( kurzbezeichnungField, 'xxxWWW' )
and this works fine.
Node.js version: v10.16.3
Testcafe version: 1.5.0
This issue looks like a bug. However, I cannot say it precisely without an example that demonstrates the problem.
My team would really appreciate it if you share your project or sample to demonstrate the issue.
Please create a separate issue in the TestCafe github repository using the following template and provide as much additional information as possible.

Switching to a new tab/window which is having xml-style-view instead of web-view in selenium

I have a scenario wherein when I click a button on a page, it gets redirected to a new page in a separate tab. Now the new page is not a regular page, And when I use normal switchTo().window() operations, it does not work saying "Web view not found, target window closed.
How should I handle this scenario in selenium
A screenshot of the result xml-viewer-style page
What is the resultant pages complete path? Does it end with XML? And why do you want that page? I believe that page is an XML file opening in a new tab. If you have stuff to retrieve from that page, you need to first download it as an XML file. Then use a parser to retrieve the data from it.
You can use DOM to parse an XML file like so:
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
InputSource is = new InputSource(new StringReader(response));
Document doc = builder.parse(is);
NodeList nList = doc.getElementsByTagName("item");
Node namedItem = nList.item(0).getAttributes().getNamedItem("uid");
System.out.println(namedItem.getNodeValue());
Now before you even can do that, you have to get that file to your local system.
You can do it using a dummy argument in the href for your file like so
<a href="http://link/to/file.xml?dummy=dummy" download>Download Now</a>

Display PDF from application server in Webdyn Pro ABAP

I'm working on a report which contains actions allowing the user to reach a a new page. In this new page pdf stored on the application server has to be displayed.
On the PDF view I created an interactive form linked with my context (PDF_DATA-PDF : xstring)
gv_filepath = '/tmp/test.pdf'.
" Open the file in binary mode
OPEN DATASET gv_filepath FOR INPUT IN BINARY MODE.
IF sy-subrc = 0.
READ DATASET gv_filepath INTO gv_filedata.
IF sy-subrc = 0.
CLOSE DATASET gv_filepath. "Close the file
" Convert the file from hex-string to Binary format
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = gv_filedata
IMPORTING
output_length = gv_filesize
TABLES
binary_tab = gt_bin_data.
Here, I don't know what to do ....
lo_node = wd_context->get_child_node( 'PDF_DATA' ).
lo_node->set_attribute( name = 'PDF' value = ?).
wd_comp_controller->gestion_affichage( ).
ENDIF.
ENDIF.
Please suggest how do I handle this?
There are a couple of ways to implement this:
Use a FileDownload element and perform the operations you described above in the Supply method of the context element. That's probably the easiest way to implement this, but it might have the drawback that the file is not displayed, but offered for download instead. It's worth giving it a try though since it's very easy to implement.
Create a new ICF service (not a WebDynpro application!) that will return the PDF file with an appropriate MIME type when requested. Then, open a new browser window with the URL of that service.
As before, but use an IFrame element to display the PDF file in-place. Be aware that the usage of this element is discouraged (although probably only to push customers towards EP...?).
To display a PDF file in Web Dynpro ABAP page,
Add the InteractiveForm control to the View
Bind the pdfSource property to the Context node containing the PDF content
Load the PDF file to the context node
Here is an example with screen shots
Well i solved my problem with my colleague, thank you
I just have to add the following code after the OPEN DATASET
CLEAR l_len.
CLEAR l_data_tab.
DO.
READ DATASET gv_filepath INTO l_data actual LENGTH l_len.
IF sy-subrc <> 0.
IF l_len > 0.
file_size = file_size + l_len.
APPEND l_data to l_data_tab.
ENDIF.
EXIT.
ENDIF.
file_size = file_size + l_len.
APPEND l_data to l_data_tab.
ENDDO.

Drupal 7 - Print PDF and Panelizer

Hi guys ,
I'm currently working on a Drupal project which use the Panelizer module by overriding the default node display. The panel for this content type is made width a lot of rules and specifications in order to display some specific content (like views) according some fields.
Now I need to print in PDF the same content that is displayed by the panelizer module but in another display (in one column ), so I cloned the display I use and rearranged it to display what I want.Then I want to use this display width the print module but I didn't managed to do that.
Any idea how can I do that ?
I just can't use the default node render, because I would miss some informations dues to the specifications used in the panel, and I can't print the panelized content because it's not the same display.
I read this thread but how can I say to the print module to use the "print" display I cloned instead of the default one ?
Any suggestions or ideas will be appreciated or if you have another idea for doing that you're welcome :)
Thank you !
In your print pdf template you can load the node then create a view with the display and finally render it : drupal_render(node_view(node_load($node->nid), "name of your display")) ;
Another way is to alter node entity info, telling that 'print' view can be panelized, i.e.
/**
* Implements hook_entity_info_alter().
*/
function mymodule_entity_info_alter(&$entity_info) {
$entity_info['node']['view modes']['print']['custom settings'] = TRUE;
...
}
After that, you go to panelizer settings of your content type(s), and set whatever you want for the print view mode

Read Excel File in GUI and write back to a File

Short Summary:
Open Excel file in GUI with one row and it's records, analyze it and
write back to a file.
I am working on a project that has lots of records in Excel file. The data has web URL that I have to analyze and write appropriate comments about it.
Copying and pasting can be hectic as there are hundreds and hundreds of records.
So, I am thinking to automate the process.
What I'd like to do is have a GUI that would populate one record at a time in the GUI. Open the URL in IE. It will have some extra fields (drop down, input box) in addition to its original columns so I can record the analysis data.
Based on the drop down option, it will create a document (or append if it already exists) that record. Once clicked save, it will populate the next record.
What would be a best way to go? I thought of using Visual Basic because of its GUI, but everyone knows about VB and why I should avoid it.
I'm also thinking about web app, so it will not be OS dependent, but I am not sure how Excel files work with PHP, other web scripting languages.
Any input would be greatly appreciated. If you know any tutorial that can give some insight, will also help.
I would do this with some javascript on an html page. Here's an outline of a general strategy with a few examples, none have been tested. There's probably better ways to do some of this stuff.
Step 1 - Convert spreadsheet to CSV
File->Save As->Save as Type->CSV
Step 2 - An HTML page to act as a viewer for the URLs
Example:
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="myAutomationScript.js"></script>
</head>
<body>
<table id="csvRecord">
<tr id="header"></tr>
<tr id="data"></tr>
</table>
<input id="nextRecord" type=submit />
<iframe id="viewer"></iframe>
</body>
</html>
Step 3 - Parse CSV
There's a jQuery plugin from this answer that will parse the CSV for you. You can read in the file (described here), or if this is a one-off thing you could just copy and paste the csv data into a string variable in your javascript file.
var csv = "",//populate this from file, or paste in data or whatever
records = $.csv.toObjects(csv),
keys = Object.keys(records[0]),
currentRecord = 0;
Step 4 - Display record in form
function displayHeaders (keys) {
//create a header cell for each key
//add a header (or headers) for your additional fields
}
function displayRecord (record) {
//populate a td cell for each piece of data
//add input element(s) for your additional review fields
//set the source of the iframe to the url
$('#viewer').setAttr('src',record.url);
}
Step 5 - Save the record and move on to the next
//this would be a handler for the click event of nextRecord
function moveOn() {
//read in data from the csvRecord table
//add the record to another collection, or read in the output file and add a line
//save the collection, or string or whatever to a local file using the html5 local file api
//++ currentRecord, and display that
currentRecord = currentRecord + 1;
displayRecord(records[currentRecord]);
}