Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- header('Access-Control-Allow-Origin: *');
- $report = $_POST['report'];
- $report_file = fopen("report.txt", "w");
- fwrite($report_file, $report);
- fclose($report_file);
- Selenium.prototype.doSaveCopyPaste = function(locator) {
- $ = _getGlobalVar('jQuery');
- var text = $(locator).text();
- var formData = new FormData();
- formData.append('report', text);
- $.ajax({
- type: 'POST',
- url: 'http://copypaste.test',
- data: formData,
- dataType: 'text',
- processData: false,
- contentType: false,
- success: function(){
- alert('Success');
- },
- error: function() {
- alert('failed');
- }
- });
- }
- command: saveCopyPaste Target: #plain-report Value:
- var text = $('#plain-report').text();
- var formData = new FormData();
- formData.append('report', text);
- $.ajax({
- type: 'POST',
- url: 'http://copypaste.test',
- data: formData,
- dataType: 'text',
- processData: false,
- contentType: false,
- success: function(){
- alert('Success');
- },
- error: function() {
- alert('failed');
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement