小编Jan*_*ski的帖子

NoSuchElementExeption,selenium无法定位元素

我想在selenium找到我的TextField,但我不知道如何(我第一次使用sellenium).

我试过了:

 driver.findElement(By.id("originTextField"))
Run Code Online (Sandbox Code Playgroud)

或者由xPath和cssSelector由开发工具中的chrome生成的字符串.

请帮助我,我会很感激的解释.

这是html:

在此输入图像描述

selenium webdriver css-selectors selenium-chromedriver selenium-webdriver

9
推荐指数
1
解决办法
2万
查看次数

无法解析类或包'h2'

我为我的网络应用程序预制了后端.在我的项目(SpringBoot + Maven)中,我想添加h2日期库.根据网站的教程:

  1. 添加到application.properties

     server.port = 8088
     spring.h2.console.enabled=true
     spring.h2.console.path=/h2
     spring.datasource.url=jdbc:h2:mem:testdb
     spring.datasource.username=sa
     spring.datasource.password=
     spring.datasource.driverClassName=org.h2.Driver    //h2 seems to be NOT found
     spring.jpa.show-sql=true
    
    Run Code Online (Sandbox Code Playgroud)
  2. 添加了对pom.xml的依赖项

     <dependency>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-data-jpa</artifactId>
     </dependency>
     <dependency>
         <groupId>com.h2database</groupId>
         <artifactId>h2</artifactId>
     </dependency>
    
    Run Code Online (Sandbox Code Playgroud)

问题:

application.properties中:"无法解析类或包'h2'"

全面检查: "检查Spring Boot应用程序.properties配置文件.突出显示未解析和弃用的配置键和无效值.仅适用于Spring Boot 1.2或更高版本."

当然,我的Spring Boot高于1.2(1.5.8).我在网上发现了类似的问题,但"重新编码依赖"不起作用,所以我仍然没有解决方案:).请帮忙.

java spring h2 maven spring-boot

5
推荐指数
1
解决办法
3597
查看次数