Posts

Showing posts with the label exception

How to SendKeys to input element that is created ad hoc when clicking in div element parent?

Image
Clash Royale CLAN TAG #URR8PPP How to SendKeys to input element that is created ad hoc when clicking in div element parent? I am stuck in this problem: our webpage has a dynamic table that will load values (students' marks) on a div element. If we click on said div , a new child element input will be appended to the div and we should be able to input a new mark using SendKeys method. However, when I try to SendKeys, a StaleElementReferenceException appears. div div input div SendKeys StaleElementReferenceException Here is the element when the input is added (had to use a breakpoint as the element disappears as soon as the div element loses focus): input div <tr> <td class="indice">1</td> <td id="accion-1-alumno-0" data-tooltip="" title="Bustos, Guido" class="has-tip titulo">Bustos, Guido</td> <td data-tooltip="" title="1º ESA" class="has-tip titulo"...

Why @Transactional not working in my code?

Image
Clash Royale CLAN TAG #URR8PPP Why @Transactional not working in my code? @Service public class SingleCityService implements ICityService { private static final Logger logger = LoggerFactory.getLogger(SingleCityService.class); @Autowired CityMmtRepo cityMmtRepo; @Autowired MmtCityService mmtCityService; @Autowired RestCityService restCityService; @PostConstruct public void init() { CityServiceFactory.getInstance().registor(EnumCity.SINGLE_CITY, this); } /** * Method to validate if action type is to Create city or Update city * * @param request * @return CityServiceResponse */ @Override public CityServiceResponse serveRequest(CityServiceRequest request) throws ResourceException, InvalidCityCreateException, SQLException { ValidatorFactory.getInstance().getRequestValidator(Validator.SINGLE_CITY_VALIDATOR).validate(request); if (CityActionType.CREATE.toString().equals(request.getEventType().getActionType())) { return createCity(request); } return updateCity...

NoSuchElementException in simple User Input loop Java 8 [on hold]

Image
Clash Royale CLAN TAG #URR8PPP NoSuchElementException in simple User Input loop Java 8 [on hold] I've looked around here a lot and haven't found an answer to my problem. I get the exception at "return in13.nextInt()". I've tried a lot of different ways of doing this "play again" thing, that's why right now I have an "int" value for it. I'd be very happy if someone showed me the best way to add this feature to my text game! Edit: This got reported for being "off-topic" because I didn't say what want the code to do, apparently. I want getPlayAgain() to run after game() runs until "user" inputs an integer other than 1. (I'm a beginner at Java) private static Scanner in13; public static void main(String args) { do { game(); } while(getPlayAgain() == 1); in13.close(); } public static int getPlayAgain() { in13 = new Scanner(System.in); ...