Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/87.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 未从div获取值_Java_Xpath_Selenium Webdriver - Fatal编程技术网

Java 未从div获取值

Java 未从div获取值,java,xpath,selenium-webdriver,Java,Xpath,Selenium Webdriver,但是,在执行其productempty时,xpath工作正常,只有getText()方法没有返回值 请建议收集日期值,然后重试(缺少空格): 您缺少空格@data bind,'text:DateofExpire'。很抱歉,我没有获取值字符串renewalDate=driver.findElement(By.xpath(//div[contains(@data bind,'text:DateofExpire'))))。getText();您有默认名称空间吗?e、 例如,xmnls=”http://

但是,在执行其productempty时,xpath工作正常,只有getText()方法没有返回值

请建议收集日期值,然后重试(缺少空格):


您缺少空格
@data bind,'text:DateofExpire'
。很抱歉,我没有获取值字符串renewalDate=driver.findElement(By.xpath(//div[contains(@data bind,'text:DateofExpire'))))。getText();您有默认名称空间吗?e、 例如,
xmnls=”http://www.w3.org/1999/xhtml“
?如果有,则必须注册该名称空间。
<div class="form-row">
<div class="label-column"> Date of Expire</div>
<div class="ctrl-column" data-bind="text: DateofExpire">Feb 23, 2014</div>
</div>
WebElement expDate = driver.findElement(By
            .xpath("//div[contains(@data-bind,'text:DateofExpire')]")).getText();
//div[contains(@data-bind,'text: DateofExpire')]