Announcement

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

    Error while exporting sclocator objects as Java / TestNG / WebDriver in Selenium IDE 2.9 with Firefox 52 ESR

    Hi Team,

    Our development team is using SmartClient for development. So on every build component IDs are changing. To address that I am exploring this user-extension.js with hope that this will help us with dynamic id issue.

    1. I read and understand that latest selenium doesn't support user-extension-ide.js. So I went back to firefor 52 ESR and selenium IDE 2.9. Was able to successfully import user-extension-ide.js and record on my application. Faced error while exporting the recorded sclocators script as Java / TestNG / WebDriver in Selenium IDE 2.9 with Firefox 52 ESR.

    Error is

    public void test() throws Exception {
    driver.get("http://localhost:8080/test.jsp?sc_selenium=true");
    // ERROR: Caught exception [unknown command [waitForElementClickable]]
    // ERROR: Caught exception [Error: unknown strategy [sclocator] for locator [scLocator=//TabSet[ID="topTabSetNONE"]/tab[title=Rules||ID=RulesTab||index=2]/]]
    // ERROR: Caught exception [unknown command [waitForElementClickable]]
    // ERROR: Caught exception [Error: unknown strategy [sclocator] for locator [scLocator=//TabSet[ID="topTabSetRules"]/tab[title=Charge%20Rule||ID=ChargeandRuleTab||index=1]/]]
    // ERROR: Caught exception [unknown command [waitForElementClickable]]
    // ERROR: Caught exception [Error: unknown strategy [sclocator] for locator [scLocator=//ExcaliburNew[ID="chargerule_newButton"]/]]
    // ERROR: Caught exception [unknown command [waitForElementClickable]]
    // ERROR: Caught exception [Error: unknown strategy [sclocator] for locator [scLocator=//ExcaliburDynamicForm[ID="chargerule_editForm"]/item[name=productTypeCode||title=Product%20Type||index=2||Class=SelectItem]/[icon="picker"]]]
    // ERROR: Caught exception [unknown command [waitForElementClickable]]
    // ERROR: Caught exception [Error: unknown strategy [sclocator] for locator [scLocator=//ExcaliburDynamicForm[ID="chargerule_editForm"]/item[name=productTypeCode||title=Product%20Type||index=2||Class=SelectItem]/pickList/body/row[value=BANKCHARGE||1]/col[fieldName=value||0]]]
    // ERROR: Caught exception [unknown command [waitForElementClickable]]
    // ERROR: Caught exception [Error: unknown strategy [sclocator] for locator [scLocator=//ExcaliburDynamicForm[ID="chargerule_editForm"]/item[name=productSubTypeCode||title=Product%20SubType||value=||index=4||Class=SelectItem]/[icon="picker"]]]
    // ERROR: Caught exception [unknown command [waitForElementClickable]]
    // ERROR: Caught exception [Error: unknown strategy [sclocator] for locator [scLocator=//ExcaliburDynamicForm[ID="chargerule_editForm"]/item[name=productSubTypeCode||title=Product%20SubType||value=||index=4||Class=SelectItem]/pickList/body/row[value=CUSTODY||1]/col[fieldName=value||0]]]
    // ERROR: Caught exception [unknown command [waitForElementClickable]]
    // ERROR: Caught exception [Error: unknown strategy [sclocator] for locator [scLocator=//ExcaliburDynamicForm[ID="chargerule_editForm"]/item[name=chargeRuleType||title=Charge%20Rule%20Type||index=6||Class=SelectItem]/[icon="picker"]]]
    // ERROR: Caught exception [unknown command [waitForElementClickable]]
    // ERROR: Caught exception [Error: unknown strategy [sclocator] for locator [scLocator=//ExcaliburDynamicForm[ID="chargerule_editForm"]/item[name=chargeRuleType||title=Charge%20Rule%20Type||index=6||Class=SelectItem]/pickList/body/row[value=BrokerFee||0]/col[fieldName=value||0]]]
    // ERROR: Caught exception [unknown command [waitForElementClickable]]
    // ERROR: Caught exception [Error: unknown strategy [sclocator] for locator [scLocator=//ExcaliburDynamicForm[ID="chargerule_editForm"]/item[name=effectiveDate||title=Effective%20Date||index=3||Class=DateTimeItem]/item[name=dateTextField||title=Effective%20Date||index=0||Class=TextItem]/element]]
    // ERROR: Caught exception [unknown command [waitForElementClickable]]
    // ERROR: Caught exception [Error: unknown strategy [sclocator] for locator [scLocator=//ExcaliburDynamicForm[ID="chargerule_editForm"]/item[name=effectiveDate||title=Effective%20Date||index=3||Class=DateTimeItem]/item[name=dateTextField||title=Effective%20Date||value=10%24fs%2412%24fs%242018||index=0||Class=TextItem]/element]]
    // ERROR: Caught exception [unknown command [waitForElementClickable]]
    // ERROR: Caught exception [Error: unknown strategy [sclocator] for locator [scLocator=//ExcaliburDynamicForm[ID="chargerule_editForm"]/item[name=expirationDate||title=Expiry%20Date||index=5||Class=DateTimeItem]/item[name=dateTextField||title=Expiry%20Date||index=0||Class=TextItem]/element]]
    // ERROR: Caught exception [unknown command [waitForElementClickable]]
    // ERROR: Caught exception [Error: unknown strategy [sclocator] for locator [scLocator=//ExcaliburDynamicForm[ID="chargerule_editForm"]/item[name=expirationDate||title=Expiry%20Date||index=5||Class=DateTimeItem]/item[name=dateTextField||title=Expiry%20Date||value=31%24fs%2412%24fs%242018||index=0||Class=TextItem]/element]]
    // ERROR: Caught exception [unknown command [waitForElementClickable]]
    // ERROR: Caught exception [Error: unknown strategy [sclocator] for locator [scLocator=//ExcaliburEdit[ID="chargerule_saveButton"]/]]
    }

    2. Do we have a sample piece of code which will demonstrate how to use user-extension.js in selenium 3.14 webdriver in eclipse ide?

    3. Or do we have some webdriver.jar(replacement of user-extension.js) which I can import in java selenium automation to access sclocator class in my eclipse ide?


    #2
    Originally posted by anshu781126 View Post
    Hi Team,

    Our development team is using SmartClient for development. So on every build component IDs are changing. To address that I am exploring this user-extension.js with hope that this will help us with dynamic id issue.

    1. I read and understand that latest selenium doesn't support user-extension-ide.js. So I went back to firefor 52 ESR and selenium IDE 2.9. Was able to successfully import user-extension-ide.js and record on my application. Faced error while exporting the recorded sclocators script as Java / TestNG / WebDriver in Selenium IDE 2.9 with Firefox 52 ESR.
    You should review the automated testing overview in our docs. From that topic note this passage:

    Selenium IDE has an option to export tests as WebDriver-compatible code. Do not use this feature, it exports useless code that doesn't understand custom commands, custom locators, or other key features of Selenium IDE. Use SeleneseRunner instead.
    We provide a tool, SeleneseRunner, as discussed in those docs, that's able to directly execute the Selenese saved by Selenium IDE, or convert it into WebDriver-based Java code for use with our SmartClientWebDriver wrapper classes. The easiest approach would just be to maintain your tests as Selenese and have SeleneseRunner directly execute them.

    Originally posted by anshu781126 View Post
    2. Do we have a sample piece of code which will demonstrate how to use user-extension.js in selenium 3.14 webdriver in eclipse ide?
    The JavaScript user-extension.js file isn't compatible with Selenium 3, but that functionality is captured by our SmartClientWebDriver wrapper class. Calls to this wrapper's APIs will automatically take our user extension logic into account. When executing Selenese, SeleneseRunner calls into this wrapper, and when converting Selenese to WebDriver-based Java code, it generates calls to the wrapper's APIs.

    Originally posted by anshu781126 View Post
    3. Or do we have some webdriver.jar(replacement of user-extension.js) which I can import in java selenium automation to access sclocator class in my eclipse ide?
    SmartClientWebDriver and associated support JARs are located in a top-level directory named lib-WebDriverSupport inside the SGWT JARs available for download.

    Comment


      #3
      SmartClientWebDriver and associated support JARs are located in a top-level directory named lib-WebDriverSupport inside the SGWT JARs available for download.
      I tried this and encountered -

      https://forums.smartclient.com/forum..._webdriver-jar

      Comment


        #4
        See response in that thread.

        Comment

        Working...
        X