Forum Discussion
Hi,
> I want right now is to be able to enter one set of data multiple times.
Isn't the Count column of the Execution Plan is what you are looking for?
I did get the system to a point where it was creating the same item multiple times. This maybe off base for this question I managed to create the dataloop but with the csv you suggested however, I have multiple required textnodes and panels with data names in them. My csv has 100 pieces of test data with the in it is there away that needs to be setup for the script to recognize those panels that need to be filled with the data from the csv.
Below is an example of the csv with the title of the item:
Source | Deal Name | Banker | LPA/Credit Analyst | Department | Deal Comments |
SXXXX | Bugs Bunny | Benne Rollins | Whitney Robers | Accounting | New Deals Starting up |
textnode13 Click ... Clicks the 'textnode13' control.
panelAnIndividualName2 Click ... Clicks the 'panelAnIndividualName2' control.
panel31 Click ... Clicks the 'panel31' control.
panel272 Click ... Clicks the 'panel272' control.
Or is there away to make it so my script is set up to receive the random data from the csv in the Source Textnode, Deal Name Textnode, LPA/Credit Analyst Text node, Deparment Text Node and then Deal Comments.
The text nodes all have the panel information in them.
- Marsha_R5 years ago
Champion Level 3
You could use a random number generator to pick a value from 1-9 and use that result to pick a value out of your table.
- AlexKaras4 years ago
Champion Level 1
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.
- Marsha_R5 years ago
Champion Level 3
Take a look at this tutorial. I think it will answer your questions.
- Marsha_R5 years ago
Champion Level 3
Can you post a screenshot of the page you are trying to fill in with the csv data? It's difficult to tell what you are trying to do from generic object names.
- Largent8035 years agoContributor
Deal Information
Create New Deal
Update
Delete
Clear
Clone Deal
Source:
Select Source of this Deal
* Deal Name:
)
* B:
* Department:
Select the Originating Department
LPA:
All of the fields except the Deal name are drop down fields with a panel that list names of who is in the drop down.
This is what I am going after is to create a csv that will pick out all of the drop down information and populate it with new data.
I can't give out to much information about the application as I because it is proprietary information. The one's with stars are required fields.
- Marsha_R5 years ago
Champion Level 3
The easiest way to do it is to record a manual test where you type in those fields. Then take that test and change the spots where you typed in the data to instead read the appropriate field from the .csv file.
https://support.smartbear.com/testcomplete/docs/testing-with/data-driven/retrieving-input.html
- Largent8035 years agoContributor
I am not changing the spot where the information is located I am changing who is using that spot so one day it could
Michael Johnson the next its John Doe.
The only criteria is that the names are in the drop down list that is contained when I select the textnode.
My CSV has those names in it along with all the information for each individual file.
- Marsha_R5 years ago
Champion Level 3
No, you don't need to change the spot. When you record a test, you will get something like
NameSpot = 'Bobby'
You change that in the test to be
NameSpot = object name of name column in csv file
Then when you put that code in the loop, it will put the name from the current line in the csv, whatever it is
the .csv file takes the place of you typing it in
- Largent8035 years agoContributor
So if I understand you correctly when I am looking at the script I should change the value to the Var record in the value area? In this case reference Var2 data driven loop.
The recording starts with the following
Item Column Operation Column Value Column Description Column
Is that correct?
- Largent8035 years agoContributor
While I can create a script for the data driven loop it is not mentioning how to make it so that I it will stop trying to
populate all the data in the data loop.
An example I used the Generate Data and created a local table.
I had one column which would have any of 9 different values which I wanted the system just to populate that one
then close.
However, the data driven loop wanted to go back and populate all the different items. I do not want that I want to have one picked and then
close it out the test.
- sonya_m4 years ago
Alumni
This is a great conversation!
Hi Largent803! Were you able to find the final solution to your question? If so, please share it.
- Largent8034 years agoContributor
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 ago
Champion Level 1
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 ago
Champion Level 1
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.