Announcement

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

    SmartClientWebDriver.verifyText for AutoFitTextAreaItem stopped working with SmartGWT

    We have been using SmartGWT 4.1 (4.1-p20140914) for some time and just upgraded to 5.0 (5.0-p20141024).

    In this version smartClientWebDriver.verifyText no longer works for AutoFitTextAreaItem.

    Our code looks something like:

    Code:
    String scLocator = "//DynamicForm[ID='CG$RECORDER$CONCLUDE$Notes']/item[title=isc_NoteTextArea_0||index=0||Class=AutoFitTextAreaItem]/element"
    By scByLocator = ByScLocator.scLocator(scLocator);
    boolean valueVerified = smartClientWebDriver.verifyText(scByLocator, text);
    // valueVerified is always returned as false in 5.1
    While this has worked for several months with 4.1, in 5.1 the verification fails and we get this in our log (in red):

    Code:
    Expected: 'Text sent to AutoFitTextAreaItem', found: ''
    It looks as though with 5.0 SmartClientWebDriver always thinks that our AutoFitTextAreaItem has nothing in it.

    #2
    The semantics of the verifyText() APIs were fixed in SC 10.0p/SGWT 5.0p to actually call WebElement.getText(), where they previously (by mistake) had been calling getValue(). For the FormItem you mention, you should be able to use verifyValue() to accomplish what you want (as a workaround for the moment).

    We may be able to provide more backward compatibility by internally calling getValue() if getText() returns nothing. We'll update this thread when a decision has been made.
    Last edited by Isomorphic; 27 Oct 2014, 15:50.

    Comment


      #3
      Originally posted by Isomorphic View Post
      For the FormItem you mention, you should be able to use verifyValue() to accomplish what you want (as a workaround for the moment).
      This worked great! Thanks.

      However, your forum discussion provided me with what I was originally looking for. Originally I just wanted a way to get the text out of the text area. It turns out that smartClientWebDriver. getValue works perfectly for that.

      BTW, using smartClientWebDriver.verifyText not only doesn't work but it corrupts the running application somehow.

      Comment


        #4
        We're not sure what you mean by "corrupts". The verifyText() API simply calls the WebDriver getText() implementation on the WebElement, and then compares the result against the supplied pattern. We may also attempt to scroll the WebElement into view as this is required by some browsers for getText() to succeed.

        Comment

        Working...
        X