Forum Discussion
This is a great conversation!
Hi Largent803! Were you able to find the final solution to your question? If so, please share it.
No I have not found any solution. I have been trying my best to figure out how I can get webelements that show up under a textnode.
My csv will work on part of the required fields but the parts that have textnodes with panel entry requirements that do not populate until
they clicked on do not show up.
Basically, I think I need to understand how to get a in between the click on the textnode and the populated data.
Here is how it looks.
textnode13 is blank I click on it.
Then the what looks like menu options appear
I believe they are webelements with the names or departments
So when I click on one it shows up as paneljohndoe
There could be multiple names or departments this applies to.
- AlexKaras4 years agoChampion Level 3
Hi,
> they won't name a specific element listing
Slightly extreme, but nevertheless: one will not get either good codebase or test code if relevant efforts were not invested into architecture.
To sum up (assuming that my understanding of your question is correct): you need to identify in reliable and stable manner web elements your test code interacts with. If you are not supported by your developers (i.e. web elements do not have unique and stable identifiers for whatever reason) then you are on your own to find out a way to find those elements. This may be search by element's text, relative search (e.g. all DIVs two level down from current element), OCR, some heuristic (e.g. web element that is next to the right from the current one), etc. Actual implementation depends on your tested application and to provide a good enough suggestion one must have a possibility to investigate your application in the Object Browser.
- AlexKaras4 years agoChampion Level 3
Hi,
> I need to understand how to get a in between the click on the textnode and the populated data.
You need to investigate your application using Object Browser / Object Spy and figure-out:
-- how to identify initial textnode;
-- how to identify the element (panel) that appears after textnode has been clicked;
-- how to identify data elements that panel is populated with;
-- How to identify the moment when data population is over.
With the above info at your hands, your test code should do the following:
-- Click the text node;
-- Wait until the panel appears on the screen;
-- Wait until the panel is populated with data;
-- Locate the data that should be clicked (defined name, random number, etc.);
-- Click data item.
Does this help?
- Largent8034 years agoContributor
I spoke with my developer and we do not name the our information in our website. This is apparently being named by the TestComplete product.
Here is the information that I found using the object spy.
Sys.Browser("edge").Page(FindElement("//div[6]/div[contains(@class, 'ant-select-item-option-content')]")
FindElement("//div[6]/div[contains(@class, 'ant-select-item-option-content')]")
I took the element name from the name property.
How would be a good way to generate the right kind of script for a csv file that I will be using.
- AlexKaras4 years agoChampion Level 3
Hi,
> we do not name the our information in our website.
This is definitely the approach that makes your life significantly more difficult.
If developers cannot/do not want to add unique and stable identifiers to web elements your test code needs to interact with and you cannot convince them to do this, then your options are either to use OCR (and pay extra for additional license) or stick to those generic XPath-es that you provided and inform your stakeholders that test code will be quite brittle and flaky despite all your efforts.
Note: Unless you are going to execute your tests using browser cloud providers (like CrossBrowserTesting or BrowserStack), I would recommend to disable the Project Options | Open Applications | Web Testing -> Use XPath and CSS Selectors For Web Objects setting and switch from cross-platform to 'classic' web elements search mode which is way more functional, faster and convenient.
> csv file that I will be using
Your code will depend on what you are going to have in this .csv file and the identification approach that you will use to find required 'anchor' web element that I mentioned in my previous reply.
- Largent8034 years agoContributor
The reason my developers is I have two website which are dynamic in their listings of the webelements dropdown list. So I can be using a name that is in both secured websites. Eventually, it will become one product but for now what I need is a way to test all the listings of these elements. This is why they won't name a specific element listing because at any point in time it could be someone else's name.
Also when working with the product it could start out belonging to one department and then two weeks later be changed to another department.
Also I am using xPath and CSS selectors. I have tried namemapping and that messed up both products testing.
- Largent8034 years agoContributor
My developers do support me. The issue is that these elements are dynamic in nature I could have a item with one of these elements at 12pm and by 3pm that element could will change to another individual or department. So the names and departments have to be very dynamic when they are setup.
Also the product will be merging with another website which we have which similar so everything has to be dynamic this includes individuals who things are assigned to as well as departments that it is going to.
Related Content
- 4 years ago
- 8 years ago
- 4 years ago
Recent Discussions
- 3 days ago