The item is shaded (the server did not provide information about the stacks) automation in the edge browser with selenium

org.openqa.selenium.WebDriverException: The item is closed (WARNING: the server did not provide any stack information). This code works fine for chrome and firefox, but not with the browser.

     `public class Login {
            public WebDriver driver;
            By userName = By.id("ctl14_UserName");
            By password = By.id("ctl14_Password");
            By login = By.id("ctl14_LoginButton");

            public Login(WebDriver driver) {
                this.driver = driver;
            }
            // Set password in username textbox
            public void setUserName(String strUserName) {   
                driver.findElement(userName).sendKeys(strUserName); 
            }
            // Set password in password textbox
            public void setPassword(String strPassword) {
                driver.findElement(password).sendKeys(strPassword);
            }
          public void clickMyaccount(){
               driver.findElement(myAccount).click();
            }
        // Click on login button
            public void clickLogin() {
                driver.findElement(login).click();

            }
        }
        //Test class
        public class AdminLogin extends BaseForDifferentLogins {
                 Login objLoginAdmin;
                 @Test(priority=0)
                    public void login() throws InterruptedException{
                      objLoginAdmin=new Login(driver); 
                      objLoginAdmin.clickMyaccount();
                        Thread.sleep(3000);
                        objLoginAdmin.setUserName("superuser1");
                        objLoginAdmin.setPassword("superuser1");
                        Thread.sleep(3000);
                        objLoginAdmin.clickLogin();
                        Thread.sleep(3000);
                    }
        }`
+8
source share
8 answers

Instead of using webElement.click (), you can try to create Actions with a click and execute. Had the same problem on Edge and this helped me:

Actions actions = new Actions(webDriver); actions.click(webElement).perform();

+6
source

I ran into a problem and tried several things to solve it:

  • EdgePageLoadStrategy.Normal is enabled - it did not help;
  • disable "save password"? bubble. - did not help;
  • 100% - /. .

script , /capabilties/options. , , script. : http://www.winhelponline.com/blog/microsoft-edge-disable-zoom-reset-zoom-level-every-start/

+6

Edge. , , , , / . - MS

, , , , 100%. , - 125%. , 100%, .

browser.send_keys [:control, '0']

, ruby ​​+ watir, , Java.

+1

Angular Protractor Microsoft Edge. , , , :

  • 100% beforeEach: browser.actions().keyDown(protractor.Key.CONTROL).sendKeys('0') .keyUp(protractor.Key.CONTROL).perform();

  • : browser.actions().mouseMove(yourElementThatIsNotActuallyObscured).click().perform();

0

Zoom 100% .

0
public void clickUntillNotObsecured(WebElement elementToClick) {
    boolean obsecuredThrown = true;
    int c=0;
    while (obsecuredThrown && c<30) {
        try {
            clickOnElement(elementToClick);             
            obsecuredThrown = false;
        } catch (WebDriverException e) {
            obsecuredThrown = true;
        }
        c++;
    }
}
0

python, Edge:

from selenium.webdriver import ActionChains
actionChains = ActionChains(driver)
button_xpath  = '//xapth...' 
button = driver.find_element_by_xpath(button_xpath)
actionChains.move_to_element(button).click().perform()

DOM. , execute_script , :

button_xpath  = '//xapth...' 
button = driver.find_element_by_xpath(button_xpath)
driver.execute_script("arguments[0].click();", button)
0

, , Edge. , , 5-10 , , . Edge , , EDGE.

Thread.sleep(5000);

just try this if it doesn’t work for you, I found another solution if it doesn’t work during the click, that is, perform a click operation using javascript.

WebElement element = driver.findElement(By.id("gbqfd"));
JavascriptExecutor executor = (JavascriptExecutor)driver;
executor.executeScript("arguments[0].click();", element);

This is the solution I got from https://softwaretestingboard.com/qna/363/word-around-for-edge-driver-click https://softwaretestingboard.com/qna/745/excpetion-selenium-webdriverexception-element- obscured

At first I worked for me. If your problem has resolved my proposal, please accept the answer.

-1
source

Source: https://habr.com/ru/post/1675236/