No Remote Connection & imagefound error

Hello,

EggPlant disables my SUT connection when it fails to find a certain text on the SUT.

Here is the error message it is giving me:

No Remote Connnection imagefound error- Remote Connection Unavailable

Here is how I am using the imagefound function:

set blnElementFound to ImageFound (Text: item intElementColumn of line intIndex of TemporaryData, Language: item 1 of strLanguage, SearchType: "Text", DPI: 96, Pulsing: true, CaseSensitive: true)

I was wondering how to properly syntax the try and catch expression to catch this error.

Also, once SUT is disconnected from Eggplant, can the connection be reestablished again through coding or does the user has to physically reestablished the connection . What would be the proper syntax to connect SUT to Eggplant?

Thanks.

Comments

  • JonathanOSXJonathanOSX ForumAdmin admin
    A couple of points here.

    First, this error is a bit misleading. The actual problem is that the OCR Language you are using isn't recognized, unfortunately eggPlant doesn't deal with that as gracefully as it could and reports the error you see. The connection is actually still established. The forthcoming version, 12.20, will actually report a more useful error in this situation. For now you can handle this situation by trapping an exception around this test.
    try
       set blnElementFound to ImageFound (...)
    catch
       logWarning "OCR Error: Language String may be invalid" && item 1 of strLanguage
    end catch
    
    To answer your question though, you can establish (or re-establish) connections under script control using the connect command.
  • Thank you for the try and catch code. It helps greatly with catching the No Remote Connection error. However, the connection is lost. So I try to reestablish the connection, but when I do EggPlant keeps on flicking back and forth trying to connect. Then an error popup saying:

    Failed to connect

    Connection to Server: Port: was lost and could not be reestablished.

    The only way to reconnect to the SUT is to close down EggPlant and open it again.

    Here is how I code the catch statement

    catch

    LogWarning "OCR Error"

    connect NameOfSUT

    end catch

    What would be the proper way to try to reconnect with the SUT without having to restart EggPlant?

    Thanks.
  • JonathanOSXJonathanOSX ForumAdmin admin
    That sounds like eggPlant is getting stuck in a broken state. I think perhaps the better way to solve it (for now) is to identify which invalid language strings are being tried and to not send those.

    That particular problem is fixed for 12.20 but for now it's best not to try invoking the OCR with an invalid language.
Sign In or Register to comment.