Selenium / Firefox: Command “.click()” doesn't work with a found element

后端 未结 6 2233
陌清茗
陌清茗 2020-12-14 08:17

I tried to find a solution to this thing and I spent a lot of time, but it is almost imposible to me to do that.

The matter: I am using Selenium with Java in Firefox

6条回答
  •  庸人自扰
    2020-12-14 09:16

    I have some solution, make a class with a robot put there TAB event keys, then call that class. What it does its like a back to focus to the page. For some razon the page lost focus and never find that botton.

       Robot robot;
        try {
            robot = new Robot();
            robot.keyPress(KeyEvent.VK_TAB);
            robot.keyRelease(KeyEvent.VK_TAB);
    
        } catch (AWTException e) {e.printStackTrace();}
    

提交回复
热议问题