Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.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
Selenium Junit将文本从webelement写入excel_Selenium - Fatal编程技术网

Selenium Junit将文本从webelement写入excel

Selenium Junit将文本从webelement写入excel,selenium,Selenium,我想将网页中的值写入excel表格。我尝试了Getattribute值和get属性文本,它们都返回null。以下是与webelement对应的HTML代码: <span id="appointScheduleForm:preqno" class="commomSmallTextBox1">EXTAPPO-007</span> EXTAPPO-007 我想获取EXTAPPO-007值,将其写入excel。请帮助放置您试图检索属性值的代码。这将帮助我们缩小原因。下面

我想将网页中的值写入excel表格。我尝试了Getattribute值和get属性文本,它们都返回null。以下是与webelement对应的HTML代码:

   <span id="appointScheduleForm:preqno" class="commomSmallTextBox1">EXTAPPO-007</span>
EXTAPPO-007

我想获取EXTAPPO-007值,将其写入excel。请帮助放置您试图检索属性值的代码。这将帮助我们缩小原因。下面是代码:WebElement MRN=AppLogin.f1.findElement(By.id(“appointScheduleForm:preqno”);字符串mrn=mrn.getAttribute(“文本”);字符串mrn1=MRN.getAttribute(“值”);