0

For my test, I am using protractor. The test first opens an Angular page, do some actions and then open a nonangular site. For the nonangular site I did the following:

it('should login on BC', function(){
 browser.waitForAngularEnabled(false); // disable waiting to navigate to not Angular page
        browser.get('non angularsite');
        element(by.id('UserName')).sendKeys('user');
        element(by.id('Password')).sendKeys('pwd');
        element(by.id('submitButton')).click();
    });

    it('should confirm the quantity typed on BC', function () {
        browser.driver.manage().window().maximize();
        browser.sleep(2000);                
        element(by.className('ms-list-itemLink')).click();//click on search button
        browser.sleep(2000);
        browser.switchTo().frame(element(by.className('designer-client-frame')).getWebElement());            
        element(by.css('.thm-cont-g0-bgcolor-1 > .icon-MoreEllipsis')).click();
        browser.sleep(1000);
        element(by.linkText('BFTESTUSER')).click();
        browser.sleep(2000);
        
        element(by.css('.ms-nav-contextmenu-trigger:nth-child(3)')).click();//click on posting date
        browser.sleep(3000);

When the automation reaches the

element(by.css('.ms-nav-contextmenu-trigger:nth-child(3)')).click();//click on posting date

I got the following error:

    Failed: element not interactable
      (Session info: chrome=79.0.3945.130)
      (Driver info: chromedriver=79.0.3945.16 (93fcc21110c10dbbd49bbff8f472335360e31d05-refs/branch-heads/3945@{#262}),platform=Windows NT 10.0.18362 x86_64)
  Stack:
    ElementNotVisibleError: element not interactable
      (Session info: chrome=79.0.3945.130)
      (Driver info: chromedriver=79.0.3945.16 
  • Try implementing WebDriver waits – Updesh Kumar Feb 17 at 11:40
0

You have to wait till element able to receive click so it would be intractable.

Please try below code with wait.

var elm = element(by.css('.ms-nav-contextmenu-trigger:nth-child(3)'));
var EC = protractor.ExpectedConditions;

browser.wait(EC.elementToBeClickable(elm), 15000);
elm.click();
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.