Closed DannyAustralia closed 10 years ago
MMm. This should be possible. You would the popup is not present as a separate element, but you should be able to set the file location to the input element and upload it.
Could you add the snippet of HTML in that contains the actual file upload element? Op 5 dec. 2013 02:27 schreef "DannyAustralia" notifications@github.com:
I am trying to upload a file with the browse box popup. Normally when webdriver has loaded firefox I type:
driver.FindElement(By.Id("IdOfUploadButton")).SendKeys("C:\Users\Danny\Desktop\myPicToUpload.jpg");
But with Simple browser I get this error: "Can only set the Value attribute for select, textarea and input elements"
Is there a way to do this with simpleBrowser?
Hope this question is in the right place. Thanks to all for making SimpleBrowser available.
Danny
— Reply to this email directly or view it on GitHubhttps://github.com/axefrog/SimpleBrowser/issues/77 .
Hi Thanks for your response. Sorry I was so slow getting back to you, been so busy.I'm not sure what you mean sorry, I'm new to programming. I think the button is embedded in JavaScript (or something). I just thought I could still do it because the HTML View in Visual studio still displays a browse button that is clickable. But when I past the HTML into an online HTML editing program the button is not clickable. I will try to use fiddler to figure out how to post a request to the server. Don't know if it will work. Would appreciate any input you might have. In case you are still interested to see the HTML code I will past it below. The Id of the button to click is "addImgs", although in firefox I have to use regex to get another id in a child node that is always changing(but that code is missing in SimpleBrowser). Thanks,Danny
Date: Wed, 4 Dec 2013 22:42:45 -0800 From: notifications@github.com To: SimpleBrowser@noreply.github.com CC: draliano@hotmail.com Subject: Re: [SimpleBrowser] Upload with browser popup box? (#77)
MMm. This should be possible. You would the popup is not present as a
separate element, but you should be able to set the file location to the
input element and upload it.
Could you add the snippet of HTML in that contains the actual file upload
element?
Op 5 dec. 2013 02:27 schreef "DannyAustralia" notifications@github.com:
I am trying to upload a file with the browse box popup.
Normally when webdriver has loaded firefox I type:
driver.FindElement(By.Id("IdOfUploadButton")).SendKeys("C:\Users\Danny\Desktop\myPicToUpload.jpg");
But with Simple browser I get this error: "Can only set the Value
attribute for select, textarea and input elements"
Is there a way to do this with simpleBrowser?
Hope this question is in the right place. Thanks to all for making
SimpleBrowser available.
Danny
—
Reply to this email directly or view it on GitHubhttps://github.com/axefrog/SimpleBrowser/issues/77
.
— Reply to this email directly or view it on GitHub.
<!DOCTYPE html>
<!--[if IE]><![endif]-->
<!--[if lt IE 7 ]> <html lang="es" class="no-js ie6 lt-ie8"> <![endif]-->
<!--[if IE 7 ]> <html lang="es" class="no-js ie7 lt-ie10 lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8 ]> <html lang="es" class="no-js ie8 lt-ie10 lt-ie9"> <![endif]-->
<!--[if IE 9 ]> <html lang="es" class="no-js ie9 lt-ie10"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="es" class="no-js"> <!--<![endif]-->
<head>
<script type="text/javascript">var NREUMQ=NREUMQ||[];NREUMQ.push(["mark","firstbyte",new Date().getTime()])</script>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<title>
Describe tu producto
</title>
<link rel="shortcut icon" href="https://secure.mlstatic.com/org-img/chico/img/favicon.ico?new" type="image/vnd.microsoft.icon" />
<link href="https://a248.e.akamai.net/secure.mlstatic.com/org-img/ch/ui/0.13.1/chico-mesh.min.css" rel="stylesheet" type="text/css" />
<meta name="layout" content="sell/sellId"/>
<link rel="stylesheet" href="https://a248.e.akamai.net/secure.mlstatic.com/sell/assets/bundles/-441182183-2a1d90f96fcce3c3429efe9c7302be24.css"/>
</head>
<body>
<input type="hidden" id="context.createdItems" value="" />
<input type="hidden" id="sell_flow_id" value="1386654868643-1931658-149957032" />
<input type="hidden" id="execution" value="e1s5"/>
<div class="ml-header">
<div class="ml-header-inner">
<h1>
<a href="http://www.mercadolibre.cl" class="ml-logo es">
MercadoLibre. Donde compras y vendes de todo.
</a>
</h1>
<div class="ml-navigation">
<ul>
<li id="account" class="ml-account ch-points-rtrb" aria-describedby="ch-layer-2" style="cursor: pointer;">
<a href="https://myaccount.mercadolibre.cl/summary/" title="COPR6688923">
<span id="nickName" class="ml-nick-name">COPR6688923</span>
<i class="ch-icon-user"></i>
</a>
<ul class="ch-hide">
<li>
<a rel="nofollow" data-tracking="MENU:MIML" href="https://myaccount.mercadolibre.cl/summary/">Mi cuenta</a>
</li>
<li>
<a rel="nofollow" id="logout" href="https://www.mercadolibre.com/jms/mlc/lgz/logout?go=http%3A%2F%2Fwww.mercadolibre.cl">Salir</a>
</li>
</ul>
</li>
<!-- Add ch-hide class -->
<li class="ml-help">
<a href="http://www.mercadolibre.cl/jm/ml.faqs.framework.main.FaqsController?pageId=home" title="Ayuda" data-tracking="MENU:AYUDAS" class="ch-icon-question-sign">Ayuda</a>
</li>
</ul>
</div>
</div>
</div>
<div class="ch-wizard">
<div class="ch-box-container">
<form action="/?execution=e1s5" method="post" class="ch-form form-description" enctype="multipart/form-data" >
<ol class="ch-wizard-breadcrumb ch-steps-five">
<li><a href="/?target=qfc&execution=e1s5&_eventId=path">Elige qué publicar</a></li>
<li><a href="/?target=cs&execution=e1s5&_eventId=path">Elige la categoría</a></li>
<li class="ch-wizard-current" >Describe tu producto</li>
<li class="ch-wizard-step" >Ingresa precio y cantidad</li>
<li class="ch-wizard-step" >Confirma tu publicación</li>
</ol>
<p class="ch-actions">
<input type="submit" id="_eventId_next" name="_eventId_next" value="Continuar" class="ch-btn" />
<a href="/?execution=e1s5&_eventId=back">Volver</a>
<span id="saving" class="ch-hide">Guardando </span>
<span id="saveFinish" class="ch-hide">Guardada <span class="ch-icon-question-sign help ico"></span></span>
</form>
</div>
</div>
<script type='text/javascript'>
var publicMaps = null;
var event = "Descripción";
var autosave = {
saveMiliseconds : 40000,
load: true
};
var idTxt = {
'title': 'El título es obligatorio. <span>',
'autosaveTitle': 'Guardamos los datos de tu última publicación',
'autosaveMsg': 'Podrás retomarla desde "Vender".'
};
var pics = function(){
return '[]';
};
var picsTxt = {
loading: 'Cargando',
deleting: 'Borrando',
moving: 'Moviendo'
};
var editorConfig = {
profile: 'advanced',
useTabs: true,
lang: 'es',
messages: {
own : 'Mis fotos',
pics: 'Foto #',
validation: 'El máximo de caracteres para la descripción es 25000.',
validationSize: 40000
}
};
function GAaddEvent(elementId, event, callback) { GAaddEvent(elementId, event, callback, false); }
function GAaddEvent(elementId, event, callback, isCapturing) { var element = document.getElementById(elementId); if (element.addEventListener) { element.addEventListener(event, callback, isCapturing); return true; } else if (element.attachEvent) { return element.attachEvent('on' + event, callback); } else { el['on' + event] = callback; } }
function GAgetEventTarget(e) { if(window.event)e=window.event return e.srcElement?e.srcElement:e.target; }
try { var _gaq = _gaq || [];
function trackEventAndFollowLink(category, action, label, reference){
trackEvent(category, action, label);
setTimeout('document.location="'+reference+'"', 100);
return false;
}
function trackEvent(category, action, label){
try {
if (_gaq)_gaq.push(['mlTracker._trackEvent', category, action, label]);
} catch (err) {}
}
function GAattachEventTrack(elementId, event, parameters, followLink) {
var element = document.getElementById(elementId)
if (element) {
var callback = "trackEvent"
if (element.href && followLink) {
callback += "AndFollowLink"
parameters.push(element.href)
}
GAaddEvent(elementId, event, function(){window[callback].apply(null, parameters)})
}
}
function getTrackingDomain (domain) {
var trackingDomainArray = new RegExp('([^\.]+[\.]com([\.]?.+)*$)|([^\.]+[\.]co[\.].+$)|(([^\.]+[\.][^\.]+$))').exec(domain);
if (trackingDomainArray) return '.'+trackingDomainArray[0];
return domain
}
function getTrackingURI() {
var path = document.location.pathname;
if (document.location.search) {
path=path.concat(document.location.search);
}
if (path && '/' == path.charAt(0) && path.length > 1) path = path.substr(1);
return path;
}
function getIgnoredReferrerDomain () {
var ignoredReferrerResults = new RegExp('(http://)?(.*'+getTrackingDomain(document.domain)+')').exec(document.referrer);
if (ignoredReferrerResults) {
return ignoredReferrerResults[2];
}
return null;
}
_gaq.push(['mlTracker._setAccount', 'UA-8863458-3']); _gaq.push(['mlTracker._setDomainName', '.mercadolibre.cl']); _gaq.push(['mlTracker._setCookiePath', '/']); _gaq.push(['mlTracker._setSessionCookieTimeout', 1800000]); _gaq.push(['mlTracker._setAllowHash', false]); _gaq.push(['mlTracker._setAllowAnchor', true]); _gaq.push(['mlTracker._setClientInfo', true]); ignoredReferrer = getIgnoredReferrerDomain(); if (null != ignoredReferrer) { _gaq.push(['mlTracker._addIgnoredRef', ignoredReferrer]); }
_gaq.push(['mlTracker._trackPageview', '/SYI/ID/INT/STD']);
function loadGA() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
}
} catch (err) {}
function initOnLoadJS(){
syi.videoLoader({
"context": '.video',
"loader": '.upVideo',
"url": '#linkYoutube',
"hidden": '#hVideo',
"cancel": 'Cancelar',
"validations": {
"url": 'Usa el formato www.youtube.com',
"custom": 'Ingresa el link de tu video de YouTube.',
"wrong": 'Revisa la url de tu video.'
}
});
var titleCountDown = $('#title').countdown({
"max" : 60,
"plural" : 'Restan # caracteres.',
"singular" : 'Resta # caracter.'
});
if(window.Editor){
setTimeout(function(){
new Editor(editorConfig).init();
}, 0);
}
var descTabNavigator, descTabsLayer;
descTabNavigator = $('#descriptionTabs').tabNavigator();
descTabNavigator.on('ready', function (event) {
descTabNavigator.select(1);
$(".ch-validation.backend-validation.desc").css('margin-left',+'px');
$('input.autoResell[type=checkbox]').attr('checked', false)
var plainTextMessage = 'Solo puedes ingresar texto, sin cambiar su tamaño, fuente o color. Te recomendamos cargar tu descripción de esta forma, esto ayudará a que tus publicaciones se vean rápidamente y desde cualquier dispositivo.';
descTabsLayer = $('[arial-controls="plainText"] .ch-icon-question-sign').layer({
content:plainTextMessage,
width: 500,
event: 'click',
classes: 'ch-box-lite desc-layer'
});
descTabsLayer.position({
offset:'-10 10'
});
});
Modernizr.load({
test: Modernizr.input.placeholder,
yep: '',
nope: 'https://a248.e.akamai.net/secure.mlstatic.com/sell/assets/commons/jquery.complete-placeholder.min-584e7d7e0fb58c38215e8af43a64ca33.js',
callback: function(url, result, key){
if (!result) {
$(document).placeholder({
'set_class' : true,
'class_name' : 'placeholder',
'skip' : false,
'ie_submit_swap' : false, // If fallback validation isn't working in IE try setting to false.
'ie_password_callback' : '' // Takes string to analyze and returns boolean. Workaround for if swap doesn't work.
});
}
}
});
try{_gaq.push( ['mlTracker._set', 'page', '/SYI/ID/INT/STD']);}catch(e){}
/*
if test="false">
syi.polls({
validation: 'No te olvides de dejarnos tu comentario.'
});
g:if>
*/
var layer = $('#account').layer({
content: $('#account ul').html(),
event: 'click',
classes: 'ch-layer-header',
points: 'rt rb',
offset: '-4 7',
width: 150,
onShow: function(){
$('#account a').on('click', function(){
layer.hide();
});
},
onHide: function(){
$('#account a').off('click');
}
});
callDejavu({"CUST_ID":"149957032","PAGE_ID":"SYI","STEP_ID":"ID","_siteId":"MLC","PROFILE_ID":"INT","VERTICAL_ID":"STD"});
};
function initAllDependantJS(){
};
</script>
<!-- same domain -->
<script type="text/javascript">
(function(e,t){var n=function(){return{js:function(e,t){if(typeof e==="string"){e=[e]}var n=document.getElementsByTagName("script")[0];var r={t:e.length,i:0,r:function(){return r.t===r.i}};var i=function(){r.i++;if(t&&r.r()){t()}};var s=function(){if(n.readyState){return function(e){e.onreadystatechange=function(){if(e.readyState==="loaded"||e.readyState==="complete"){e.onreadystatechange=null;i()}}}}else{return function(e){e.onload=function(){i()}}}}();var o=0;var u=document.createElement("script");for(o;o<r.t;o++){var a=u.cloneNode(true);s(a);a.src=e[o];a.async=true;n.parentNode.insertBefore(a,n)}}}}();e.src=n})(window)
window.onload = function(){
src.js( "https://a248.e.akamai.net/secure.mlstatic.com/org-img/ch/ui/0.13.1/chico-jquery.min.js?no=c",function(){
src.js("/assets/bundles/1211380314.js", function(){
initOnLoadJS();
initAllDependantJS();
loadGA();
});
});
};
</script>
<div class="footer mainFooter">
<p>El uso de este sitio web implica la aceptación de los <a href="http://www.mercadolibre.cl/seguro_terminos.html" id="FOOT:TERMS">Términos y Condiciones</a> y de las <a href="http://www.mercadolibre.cl/seguro_privacidad.html" id="FOOT:POLITICAS">Políticas de Privacidad</a> de MercadoLibre Chile Ltda.</p>
<p>Copyright © 1999-2013 MercadoLibre Chile Ltda.</p>
<script type="text/javascript">if (!NREUMQ.f) { NREUMQ.f=function() {NREUMQ.push(["load",new Date().getTime()]);var e=document.createElement("script");e.type="text/javascript";e.src=(("http:"===document.location.protocol)?"http:":"https:") + "//" + "js-agent.newrelic.com/nr-100.js";document.body.appendChild(e);if(NREUMQ.a)NREUMQ.a();};NREUMQ.a=window.onload;window.onload=NREUMQ.f;};NREUMQ.push(["nrfj","beacon-6.newrelic.com","07d02feefb",891786,"MwdQbRZWVhEFUkUKXApNQVwIWxcLAA==",0,146,new Date().getTime(),"","","","",""]);</script>
</body>
</html>
Hi Danny,
If the solution you are testing relies on javascript, SimpleBrowser is not your tool. There are automated browsers out there that support scripting, but typically not as lightweight as SimpleBrowser is.
However, if we inspect the code you are testing a bit closer, it seems that the solution is designed to also work with non-javascript browsers. It contains this block:
Note the element with id picturesNative? You can use that from SimpleBrowser. You set the value to your local filename and submit the form (by clicking uploadPicture).
Good luck, Teun
2013/12/10 DannyAustralia notifications@github.com
Hi Thanks for your response. Sorry I was so slow getting back to you, been so busy.I'm not sure what you mean sorry, I'm new to programming. I think the button is embedded in JavaScript (or something). I just thought I could still do it because the HTML View in Visual studio still displays a browse button that is clickable. But when I past the HTML into an online HTML editing program the button is not clickable. I will try to use fiddler to figure out how to post a request to the server. Don't know if it will work. Would appreciate any input you might have. In case you are still interested to see the HTML code I will past it below. The Id of the button to click is "addImgs", although in firefox I have to use regex to get another id in a child node that is always changing(but that code is missing in SimpleBrowser). Thanks,Danny
Date: Wed, 4 Dec 2013 22:42:45 -0800 From: notifications@github.com To: SimpleBrowser@noreply.github.com CC: draliano@hotmail.com Subject: Re: [SimpleBrowser] Upload with browser popup box? (#77)
MMm. This should be possible. You would the popup is not present as a
separate element, but you should be able to set the file location to the
input element and upload it.
Could you add the snippet of HTML in that contains the actual file upload
element?
Op 5 dec. 2013 02:27 schreef "DannyAustralia" notifications@github.com:
I am trying to upload a file with the browse box popup.
Normally when webdriver has loaded firefox I type:
driver.FindElement(By.Id("IdOfUploadButton")).SendKeys("C:\Users\Danny\Desktop\myPicToUpload.jpg");
But with Simple browser I get this error: "Can only set the Value
attribute for select, textarea and input elements"
Is there a way to do this with simpleBrowser?
Hope this question is in the right place. Thanks to all for making
SimpleBrowser available.
Danny
—
Reply to this email directly or view it on GitHub< https://github.com/axefrog/SimpleBrowser/issues/77>
.
— Reply to this email directly or view it on GitHub.
<!DOCTYPE html>
Describe tu producto — Reply to this email directly or view it on GitHubhttps://github.com/axefrog/SimpleBrowser/issues/77#issuecomment-30200379 .
Thanks so much for your help! I really appreciate it. And you even explained how you found the solution, so I can do it in future. Have a good day,Danny
Date: Tue, 10 Dec 2013 09:19:48 -0800 From: notifications@github.com To: SimpleBrowser@noreply.github.com CC: draliano@hotmail.com Subject: Re: [SimpleBrowser] Upload with browser popup box? (#77)
Hi Danny,
If the solution you are testing relies on javascript, SimpleBrowser is not
your tool. There are automated browsers out there that support scripting,
but typically not as lightweight as SimpleBrowser is.
However, if we inspect the code you are testing a bit closer, it seems that
the solution is designed to also work with non-javascript browsers. It
contains this block:
Note the element with id picturesNative? You can use that from
SimpleBrowser. You set the value to your local filename and submit the form
(by clicking uploadPicture).
Good luck,
Teun
2013/12/10 DannyAustralia notifications@github.com
Hi Thanks for your response. Sorry I was so slow getting back to you, been
so busy.I'm not sure what you mean sorry, I'm new to programming. I think
the button is embedded in JavaScript (or something). I just thought I could
still do it because the HTML View in Visual studio still displays a browse
button that is clickable. But when I past the HTML into an online HTML
editing program the button is not clickable. I will try to use fiddler to
figure out how to post a request to the server. Don't know if it will work.
Would appreciate any input you might have. In case you are still interested
to see the HTML code I will past it below. The Id of the button to click is
"addImgs", although in firefox I have to use regex to get another id in a
child node that is always changing(but that code is missing in
SimpleBrowser).
Thanks,Danny
Date: Wed, 4 Dec 2013 22:42:45 -0800
From: notifications@github.com
To: SimpleBrowser@noreply.github.com
CC: draliano@hotmail.com
Subject: Re: [SimpleBrowser] Upload with browser popup box? (#77)
MMm. This should be possible. You would the popup is not present as a
separate element, but you should be able to set the file location to the
input element and upload it.
Could you add the snippet of HTML in that contains the actual file upload
element?
Op 5 dec. 2013 02:27 schreef "DannyAustralia" notifications@github.com:
I am trying to upload a file with the browse box popup.
Normally when webdriver has loaded firefox I type:
driver.FindElement(By.Id("IdOfUploadButton")).SendKeys("C:\Users\Danny\Desktop\myPicToUpload.jpg");
But with Simple browser I get this error: "Can only set the Value
attribute for select, textarea and input elements"
Is there a way to do this with simpleBrowser?
Hope this question is in the right place. Thanks to all for making
SimpleBrowser available.
Danny
—
Reply to this email directly or view it on GitHub<
https://github.com/axefrog/SimpleBrowser/issues/77>
.
—
Reply to this email directly or view it on GitHub.
<!DOCTYPE html>
Describe tu producto —
Reply to this email directly or view it on GitHubhttps://github.com/axefrog/SimpleBrowser/issues/77#issuecomment-30200379
.
— Reply to this email directly or view it on GitHub.
I am trying to upload a file with the browse box popup. Normally when webdriver has loaded firefox I type:
driver.FindElement(By.Id("IdOfUploadButton")).SendKeys("C:\Users\Danny\Desktop\myPicToUpload.jpg");
But with Simple browser I get this error: "Can only set the Value attribute for select, textarea and input elements"
Is there a way to do this with simpleBrowser?
Hope this question is in the right place. Thanks to all for making SimpleBrowser available.
Danny