• [Selenium]重写拖拽dragWidgetToElementContainner()


    public void dragWidgetToElementContainner(String widgetName, String targetPosition){
    		WebElement widgetIconEl=page.getWidgetIconInDockMenu(widgetName);
    		((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView();", widgetIconEl);
    		WebElement elementContainer=null;
    		if(targetPosition.equals("left")){
    			elementContainer=SeleniumUtil.waitForElementPresent(driver, By.cssSelector("div#wsp-wrap-body div.x-box-target div.x-container:nth-child(1)"));
    		}
    		if(targetPosition.equals("right")){
    			elementContainer=SeleniumUtil.waitForElementPresent(driver, By.cssSelector("div#wsp-wrap-body div.x-box-target div.x-container:nth-last-child(1)"));
    		}
    		WebElement dropableEl=page.getDropableIconInWorkspace();
    		this.dragAndDropToElementContainner(driver,widgetIconEl,dropableEl,elementContainer);
    		
    		SeleniumUtil.waitUntilAllAjaxRequestCompletes(driver);
    		this.waitForLoadingDoneInNewWebPage(driver);
    		SeleniumUtil.sleep(2);
    	}
    
    public void dragAndDropToElementContainner(WebDriver driver, WebElement dragableEl, WebElement dropableEl,  WebElement targetEl){
            Actions action = new Actions(driver);
            action.clickAndHold(dragableEl).build().perform();
            action.moveToElement(targetEl);
            action.release(dropableEl);
            action.build().perform();
        }
    
  • 相关阅读:
    汇编指令lodsb和stosb、lodsd和stosd
    编码查询
    CLD汇编指令
    Win32编程
    MessageBox
    windows 数据类型
    STL总结
    解析结构化异常处理(SEH)(第二部分)
    FS[XX]
    ShellCode入门(提取ShellCode)
  • 原文地址:https://www.cnblogs.com/MasterMonkInTemple/p/4563314.html
Copyright © 2020-2023  润新知