I have a String variable that retrieves IDs from an Excel sheet.
String id = formatter.formatCellValue(sheet.getRow(i).getCell(2));
I am trying to dynamically update the ID using JavaScript executor, but it seems that the concatenation is not working correctly:
je.executeScript("document.querySelector('.js-react-id-"+id+" button').click()");
System.out.println("Clicked on ID " + id);
je.executeScript("document.querySelector('div[data-id='" + id + "'] .sg-action span:last-of-type svg').click()");
System.out.println("Rated 5 stars for ID " + id);
Could you provide some guidance on what I might be doing wrong?