Я прохожу очень простой тест, как ниже: < /p>
- В пределах селена (и зависимости, контролируемые через Maven), я читаю файл Excel для конкретной ячейки < /li>
Тогда, если «если», если это за значение, не требуется клет. утверждается.xpathID = cell.getStringCellValue().trim();
if (xpathID == "None") {
continue;
} else {
System.out.println("Col-Index 1 : xpathID : " + xpathID);
byte[] bytes = xpathID.getBytes(java.nio.charset.StandardCharsets.UTF_8);
System.out.println("Col-Index 1 : xpathID bytes excel : " + bytes);
xpathID = "None";
bytes = xpathID.getBytes(java.nio.charset.StandardCharsets.UTF_8);
System.out.println("Col-Index 1 : xpathID bytes hardcoded in Java : " + bytes);
driver.findElement(By.id(xpathID)).click();
}
< /code>
The print statements display following in console:
Col-Index 1 : xpathID : None
Col-Index 1 : xpathID bytes excel : [B@31c2affc
Col-Index 1 : xpathID bytes hardcoded in Java : [B@1dc2de84
< /code>
When I rerun the same script again then the hex value we get are completely different:
Col-Index 1 : xpathID : None
Col-Index 1 : xpathID bytes excel : [B@5c748168
Col-Index 1 : xpathID bytes hardcoded in Java : [B@6441c486
< /code>
Appreciate any help.
Tried removing all POI depedencies within Maven and keeping only following
poi-ooxml
5.4.1
< /code>
- Tried saving the excel file in UTF-8 encoding
- Making sure the cell type is 'Text' within Excel.
- Lot of other manevouring can provide if needed, but didn't want to make this post too long to read.
Подробнее здесь: https://stackoverflow.com/questions/796 ... using-java