org.openqa.selenium.ElementNotInteractableException:元素<option>无法滚动到视图中

时间:2019-04-03 10:08:10

标签: java selenium

我设计了数据驱动的框架。

我无法输入下拉菜单。

错误:

  

org.openqa.selenium.ElementNotInteractableException:元素   无法滚动到视图中

 public static void setValueOnWebObject(String controlType,String object,String text)
        {
            WebElement element = getWebElement(object);

        if(controlType.equals("webEdit")){       
            element.sendKeys(text);
            CustomReport.testStep("entered" + text + "successfull");        }

// I am thinks below code should work fine when entering data into dropdown
        else if(controlType.equals("weblist"))
        {   Select sel= new Select(element);
         sel.selectByVisibleText(text); } } 

public static void login() throws IOException, SQLException
    {
        invokeBrowser();        
        String query= "Select * from LoginDetails";     
        ResultSet rs= DbAccessEx.testconnection(query);         
        WebControl.setValueOnWebObject("webEdit",CommonObject.Username,rs.getString("Username"));       
        WebControl.setValueOnWebObject("webEdit", CommonObject.Password, rs.getString("Password"));
        WebControl.clickOnWebObject("webButton", CommonObject.loginBtn, "success");     
    //  WebControl.displayTextOnWebObject("webText", CommonObject.welcomeMsg);      
        WebControl.setValueOnWebObject("weblist",CommonObject.Protocol,rs.getString("Protocol"));       
     }

0 个答案:

没有答案