i want to pass a java variable to javascript..
this is part of my code:
String localArray[][] = new String[50000][9];
String strContratoNumero;
for(int i=1; i<10;i++){
strContratoNumero = localArray[i][0];
I have tried this:
((JavascriptExecutor)driver).executeScript("document.getElementById('txtNr_Contrato_Plano_Trab').value=arguments[0]",strContratoNumero.substring(0,9));
but it doesn't work.
Can you please tell me how can i make send the values through variables in the above command?
PS: i am getting data from excel sheet.. but don't worry because this part is working.
为什么不只使用字符串连接?
((JavascriptExecutor)driver).executeScript("document.getElementById('txtNr_Contrato_Plano_Trab').value='"+strContratoNumero.substring(0,9)+"'");
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.