Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Asserting SC.warn's error message with selenium

    Hi,

    I am evaluating selenium for automating our SmartGWT GUI. Currently I try to assert the message text which gets displayed with SC.warn("some text"). Unfortunately i am not able to locate the element from selenium. I copied the scLocator for the message from Selenium IDE, but when I call findElement with the locator the element is not found(message from debugger "org.openqa.selenium.remote.RemoteWebElement@6e13ad91 -> unknown locator" )

    This is the code i am using. We use SmartGWT 6.0p from 28.02.2017 and selenium-java 2.53.1
    File ff45esr = new File("C:\\Program Files\\Mozilla Firefox ESR 45\\firefox.exe");
    SmartClientWebDriver driver = new SmartClientFirefoxDriver(new FirefoxBinary(ff45esr));
    driver.get(BASE_URL);
    driver.waitForElementPresent(ByScLocator.scLocator("scLocator=//Dialog[ID="isc_globalWarn"]/messageLabel/"));
    WebElement ele = driver.findElement(ByScLocator.scLocator("scLocator=//Dialog[ID="isc_globalWarn"]/messageLabel/"));

    How can I assert the displayed message with selenium?

    Thanks
    Regards,
    Martin


    #2
    Well, the simple explanation is that the page you are testing fails to show the dialog.

    If you don't think that's the problem, please show a minimal, ready-to-run test case in which a dialog is shown but you are unable to locate it with Selenium.

    Comment

    Working...
    X