一、sendkeys()上传

  HTML源码

<td>sendkeys上传</td>
    <div id='pf'><input type='file' id='postfile'/></div>

  java代码

 WebElement pf=driver.findElement(By.xpath("//*[@id='pf']/input"));
 pf.sendKeys("C:\\sendkeys.txt");

 

 

相关文章:

  • 2021-11-04
  • 2022-03-07
  • 2021-08-01
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-22
  • 2021-05-04
  • 2021-06-08
  • 2021-11-19
相关资源
相似解决方案