Forum question posted -
Hi Team,
I am fairly new to automating Maximo application and need guidance on following topic:
I want to understand the reason to adapt the framework provided at following location and not go with creating framework by locating elements in a traditional way:
https://www.ibm.com/developerworks/community/forums/html/topic?id=2a504236-951e-4737-949b-660cfa1c895e&ps=25
Is there any issue in creating a framework using traditional TestNG and Selenium webdriver approach?
regards,
ASingh
Response -
1)
Hi ASingh.
I'm not sure what you mean by locating elements in a traditional way. The way we locate elements is by using their ID, which is unique and static. We are able to create scripts in one release and use them in all releases going forward. We are using TestNG to execute our tests and Selenium Webdriver as the underlying framework. We are using Selenium functions to perform clicks, typing, etc, but have adapted it to Maximo.
Thanks,
Kristin
2)
Hi Kristin,
I have a scenario where our Maximo developer creates a new element on webpage by copy/pasting an existing element.
As a result of the copy/paste a new element is created with a new ID.
The developer uses the original element to perform a new functionality, and uses the copied element (with a new ID), to perform the old functionality.
Because the copied element (with a new ID) is being used to perform the old functionality, our script is breaking. It is interacting with the original element (with original ID), but that element is now responsible for new functionality.
For example:
An element on a Maximo page is "Location", with ID=100
A developer needs to add a new element, "Asset Date", to the page and will do so by copy/pasting the "Location" element
When the developer copy/pastes the "Location" element, there are two identical elements, with the exception of their IDs. The original ID remains the same, ID=100, the new element is created with ID=101.
The developer takes the element with ID=100 and updates it to be the "Asset Date" element
The copied element, with ID=101, now serves as the "Location" element
Because the scripts are using the ID property to identify objects, it interacts with the wrong element, in this case the "Asset Date" element, and the script fails
Are there other properties that will not change in the scenario presented above? If so, we can use them to uniquely identify objects rather than the ID field.
Please suggest any workarounds to the scenario presented.
3)
That's just the way it works - the id's are key and you take that into account when changing things I think.
jeff
4)
The IDs should be unique from element to another, so there shouldn't be any case where there are two elements with the same ID on a page, which is why we use the element's ID.
In your post, you talk about the ID of the Location element changing and I'm confused why a developer would do that. Why would the original element change instead of the pasted element? The framework relies on the unique IDs to execute scripts. As a (not so reliable) fallback, the xpath of elements can be used, but I strongly encourage using the IDs as it is much faster and won't break when the UI changes.
Thanks,
Kristin
#AssetandFacilitiesManagement#MaximoEAM#Maximo