Failed: No element found using locator:

protractor
no element found using locator: by binding
elementarrayfinder
protractor if element found
protractor style guide
no such element unable to locate element method css selector selector #lst ib
protractor locators
protractor ispresent

When was using xpath method it throws an error

Terminal error: ( i.e Failed: No element found using locator: By(xpath, input[contains(@id, 'usertext')]) )

element(by.id("usertext")).sendKeys("help") (when i tries this way it executes perfectly)

var EC = protractor.ExpectedConditions;
describe('test MAYO site', function () {
  browser.waitForAngularEnabled(false);
  //browser.debugger();
  //login cookies
  browser.driver.manage().deleteAllCookies();
  //login page testing
  it('URL', function () {
    // get testing project login url
    var loginlink = "https://mayo-gbs-stage.orbita.cloud:8443/chatbot/"

   browser.get(loginlink);
    browser.sleep(6000);
  });
  it("input", function(){
    element(by.xpath("input[contains(@id, 'usertext')]")).sendKeys("help");
    browser.sleep(6000);
  });
});

I need to use xpath functions by that way can make proper automation without searching for attributes

You can find element with below snippet!

Using contains :

element(by.xpath("//*[contains(@id,'usertext')]"))

Using equal operator :

element(by.xpath("//*[@id='usertext']")),

Cheers!

No element found using locator: By(css selector, *[id= · Issue #152 , Hi, I thought of reporting this issue as I am not sure whether it is due to my coding / Protractor issue. I am using Protractor-Cucumber frame work  Dismiss Join GitHub today. GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.

Try this.This should work.

browser.find_element_by_xpath("//input[@id='usertext']").send_keys("help")

AngularJS testing with Protractor- no element found using locator , The most important thing in this traceback is actually this part: The following tasks were pending: - $timeout: function () { clearEvents(type); }  Failed: No element found using locator: By(css selector, option[value=“xxx”]) Hot Network Questions What was this book about books that never existed?

The reason you are getting that error is because your XPath is not properly formed. You have

input[contains(@id, 'usertext')]

but it should be

//input[contains(@id, 'usertext')]

Having said that, I don't understand why people insist on using XPaths when they aren't needed. You stated that by.id("usertext") works just fine... if that's the case, why are you using XPath? XPath is less performant, inconsistent support, and so on. You should always use ID when available, CSS selectors should be next (best support and performance), and then a last resort would be XPath only when you need to find an element by contained text or do DOM navigation.

No element found using locator: By(css selector, *[id=“username , No element found using locator: By(css selector, *[id=“username”]) - protractor. toEqual(null); }); }); it('login should fail and remain at login screen', function  here i am getting No element found using locator: By(css selector, div.scs-notifications-popover) but when i use browser.driver.findElement(by.css('div.scs-notifications-popover')) i could able to find the actual element. Please check the screenshot where the new div element added to html dom during test execution.

Protractor Tutorial - Better Console Reports, F Failures: 1) Protractor Demo Page should fail Message: Failed: No element found using locator: By(css selector, *[id="nameFld"]) Stack: NoSuchElementError:  - Failed: No element found using locator: By(css selector, pm-root h1)" Executed 1 of 1 spec (1 FAILED) in 2 secs. [11:30:16] I/launcher - 0 instance(s) of WebDriver still running

How to check if an element is present with protractor?, This works with element(locator) or ElementFinder and not with Message Failed: No element found using locator: By(css selector, .ng-empty). protractor no element found using locator by cssselector? Ask Question Asked 5 years, 2 months ago. Active 3 years, 3 months ago. Viewed 10k times 6. Getting my head

isDisplayed Error: No element found using locator instead of , I have a method isElementDisplayed with element.isDisplayed call inside. It is throwing No ElementFinder) { return element.isDisplayed(); } Hello, I am currently running protractor tests in both firefox 44 and chrome 48, I have run into an issue several times where elements with display = none return a failure message when using the .isDisplayed() method. var uploadFileButto

Comments
  • using xpath is NOT recommended, that is what protractor team says and I have to agreed protractortest.org/#/style-guide
  • Use Css locators. To do a better Ui Automation using protractor.
  • What does I need to use xpath functions by that way can make proper automation without searching for attributes even mean? You realize that your XPath is searching for the ID, which is an attribute, right? Also, you are using contains() which is not needed per your comment that by.id("usertext") works fine. You should be using ID. Full stop. But if you insist on using XPath, you can at least simplify it to //input[@id='usertext'].
  • @DebanjanB, Yes I should have add more context why I did this.Thanks.