I'm using Selenium WebDriver to automate large portions of our QA process and have read through the documentation at "Using Selenium" (https://www.smartclient.com/smartgwt...gSelenium.html), but this appears to indicate that SmartClient users need to use the older, web-based IDE version of Selenium as opposed to WebDriver itself.
However, in order to target specific UI elements (Buttons, MenuButtons, MenuItem, etc.), I need to obtain a specific ID or XPath to address the element, otherwise the automation will fail. Unfortunately, when, for example, switching from one view to the next, then back, the IDs associated with its member components changes dynamically. So, an ID or XPath cannot be reliably used to select the element and simulate a click on the element.
I've attached state1.jpg, state2.jpg from the Beanless Mode Feature Explorer example
(http://www.smartclient.com/#FShibernateConnector).
1. Open the Chrome browser (though, note that this behavior happens in all other browsers I've checked, as well).
1. Open SmartClient Feature Explorer.
2. Open Chrome Developer tools
2. Open the tree item "Beanless mode" under "Hibernate / Beans."
3. Select the "hibernateConnector.js" tab.
4. Inspect the "Try it" button with Chrome Dev Tools. In this particular instance, it initially has an XPath of //*[@id="isc_12C"]/table/tbody/tr/td and an ID of isc_12C.
5. Switch to another tree item ("HB Auto Derivation", for example).
6. Switch back to "Beanless Mode."
7. Click the "hibernateConnector.js" tab.
8. Inspect the "Try it" button with Chrome Dev Tools. The "Try it" button now has an XPath of //*[@id="isc_1A5"] and an ID of isc_1A5.
Obviously, this is only an example, as the IDs seem to be randomly generated, or programmatically incremented upon creation based on historical elements. Either way, there does not seem to be a consistent way to auto-select the elements.
I'd like to add a name or any other XPath-selectable component to the tag that *does not change*. There doesn't seem to be any easy way for our developer to do this in SmartClient without a large number of changes to the existing codebase.
Am I wrong, or is there a better way to do this that I'm just missing? So far, I am not able to get a consistent object to target my simulated clicks upon.
I appreciate your help.
However, in order to target specific UI elements (Buttons, MenuButtons, MenuItem, etc.), I need to obtain a specific ID or XPath to address the element, otherwise the automation will fail. Unfortunately, when, for example, switching from one view to the next, then back, the IDs associated with its member components changes dynamically. So, an ID or XPath cannot be reliably used to select the element and simulate a click on the element.
I've attached state1.jpg, state2.jpg from the Beanless Mode Feature Explorer example
(http://www.smartclient.com/#FShibernateConnector).
1. Open the Chrome browser (though, note that this behavior happens in all other browsers I've checked, as well).
1. Open SmartClient Feature Explorer.
2. Open Chrome Developer tools
2. Open the tree item "Beanless mode" under "Hibernate / Beans."
3. Select the "hibernateConnector.js" tab.
4. Inspect the "Try it" button with Chrome Dev Tools. In this particular instance, it initially has an XPath of //*[@id="isc_12C"]/table/tbody/tr/td and an ID of isc_12C.
5. Switch to another tree item ("HB Auto Derivation", for example).
6. Switch back to "Beanless Mode."
7. Click the "hibernateConnector.js" tab.
8. Inspect the "Try it" button with Chrome Dev Tools. The "Try it" button now has an XPath of //*[@id="isc_1A5"] and an ID of isc_1A5.
Obviously, this is only an example, as the IDs seem to be randomly generated, or programmatically incremented upon creation based on historical elements. Either way, there does not seem to be a consistent way to auto-select the elements.
I'd like to add a name or any other XPath-selectable component to the tag that *does not change*. There doesn't seem to be any easy way for our developer to do this in SmartClient without a large number of changes to the existing codebase.
Am I wrong, or is there a better way to do this that I'm just missing? So far, I am not able to get a consistent object to target my simulated clicks upon.
I appreciate your help.
Comment