Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ...Element MyElement is not clickable at point (x, y)... Other element would receive the click...
- WebElement element = driver.findElement(By.id("id1"));
- Actions actions = new Actions(driver);
- actions.moveToElement(element).click().build().perform();
- JavascriptExecutor jse1 = (JavascriptExecutor)driver;
- jse1.executeScript("scroll(250, 0)"); // if the element is on top.
- jse1.executeScript("scroll(0, 250)"); // if the element is at bottom.
- WebElement myelement = driver.findElement(By.id("id1"));
- JavascriptExecutor jse2 = (JavascriptExecutor)driver;
- jse2.executeScript("arguments[0].scrollIntoView()", myelement);
- WebDriverWait wait2 = new WebDriverWait(driver, 10);
- wait2.until(ExpectedConditions.elementToBeClickable(By.id("id1")));
- driveme = new ChromeDriver();
- driver = new EventFiringWebDriver(driveme);
- ActivityCapture handle=new ActivityCapture();
- driver.register(handle);
- @Override
- public void beforeClickOn(WebElement arg0, WebDriver event1) {
- try {
- System.out.println("After click "+arg0.toString());
- //System.out.println("Start afterClickOn - timestamp: System.currentTimeMillis(): " + System.currentTimeMillis());
- JavascriptExecutor executor = (JavascriptExecutor) event1;
- StringBuffer javaScript = new StringBuffer();
- javaScript.append("for (var c in Wicket.channelManager.channels) {");
- javaScript.append(" if (Wicket.channelManager.channels[c].busy) {");
- javaScript.append(" return true;");
- javaScript.append(" }");
- ;
- ;
- ;
- javaScript.append("}");
- javaScript.append("return false;");
- //Boolean result = (Boolean) executor.executeScript(javaScript.toString());
- WebDriverWait wait = new WebDriverWait(event1, 20);
- wait.until(new ExpectedCondition<Boolean>() {
- public Boolean apply(WebDriver driver) {
- return !(Boolean) executor.executeScript(javaScript.toString());
- }
- });
- //System.out.println("End afterClickOn - timestamp: System.currentTimeMillis(): " + System.currentTimeMillis());
- } catch (Exception ex) {
- //ex.printStackTrace();
- }
- }
Add Comment
Please, Sign In to add comment