Contributions
Re: Want to add a new column in excel for a data driven loop
So, after spending last night thinking about the problem, Shankar's first response got me thinking and I gave the project to a colleague to try on his computer to see if it was just my setup, since what I wanted to happen was working like I expected for Shankar. My co worker opened the project, edited sheet 1 of the spreadsheet and it worked for him the way it did for Shankar. I then took his copy of the project and put it on a laptop we lend to contractors and it didn't work there. Then I realized the problem, my co worker edited sheet 1! When i was opening the spreadsheet it was defaulting to sheet 4 which is the master list of all available countrys, not the working list for the current execution... So it was something embarrassingly simple that was the problem, user error. I had been editing sheet 4 in excel and in test complete I was looking at sheet 1! Thank you for the help everyone!2.9KViews1like0CommentsRe: Want to add a new column in excel for a data driven loop
I will try to respond to everyone’s questions/statements in this post: shankar_r Question: Have you tried like this? Or i misunderstood your question? Reponse: Your description of the issue is accurate but your results are different than mine. I have even tried changing the order of the columns in the spreadsheet that TC does “see” but it seems to have no effect on what I see from within TC. Statement: During your get data you can skip the 1st row. Response: TC has the option to treat the first row as column names when creating the DB variable in the wizard and I have this selected. AlexKaras Question :“Can you provide a screenshot(s) of how your db variable is defined?” Response: I have attached a series of screenshots that show how I defined the db variable. Statement:For example, the problematic last column in Excel may be empty for several initial rows and ADO engine may consider it not to be within data set if the data query looks like "Select * From [$Sheet1]". Response: The newly added column (G) has the same rows populated as the column before it (F), and I have no problems with using that column. The first row of every column has the header that is used by the data driven loop to define the variable for that column. I sincerely appreciate everyone'shelp, i am sure this is something basic. I am only using the built in operations for keyword tests so how complicated could it be...|\1.5KViews0likes3Comments- 2.7KViews0likes0Comments
Re: Want to add a new column in excel for a data driven loop
I deleted the db variable and tried to add it back in, it only sees six columns instead of seven. I renamed the db thentried to add it back in, it only sees six columns instead of seven. I deleted the entire data loop (copy the contents of the loop then deleting everything and pasting back the contents) then tried to add the data loop back in, it only sees six columns instead of seven. Hey testcomplete, this should be a feature to be able to do what I am trying, it shouldn'tbe so convoluted...2.7KViews0likes10CommentsRe: Want to add a new column in excel for a data driven loop
It isn't a table variable it is a db variable. When i try to point a step to the new column in the spreadsheet, the new column isn't listed while all the original columns are. I am not sure i am explaining this correctly. I have attached a screenshot of the spreadsheet and two screenshots of what TestComplete is "seeing". The last column of the spreadsheet, the one i recently added, is not being shown/seen by TestComplete.2.7KViews0likes12CommentsWant to add a new column in excel for a data driven loop
I have a data driven loop that is pulling from an excel spreadsheet. Four of the six columns are for products the company offers and the company has added a fifth product, so i wanted to add a new column to the excel spreadsheet and addanother section to the keyword test for the new product. I add the column, but when I go into testcomplete, it does not see the new column. As a matter of fact, if delete or change the order of the columns it still doesn't seem to see the change. I tried to go through the "select data variable" wizard for the data driven loop and re-select the same spreadsheet, but when you get to the step where you select the sheet within the spreadsheet I press the "View Sheet" button and it still has the original sheet layout. I tried redirecting the data driven loop to a copy of the edited spreadsheet in a different folder and it still shows the layout for the old spreadsheet. Can somebody explain to me what is going on and if/how i can add a column to the spreadsheet for the data driven loop?Solved3.3KViews0likes14CommentsRe: Want a single log entry that prints a value from a spreadsheet AND a variable from the Keyword
That worked! I created a string variable "Country" in the Sheet1 keyword test. I then set that variable toKeywordTests.Sheet1.Variables.CountryLanguageTestSet["Country"] and then I can grab this variable from the other keyword tests and it is updated every time the data driven loop starts again. I was getting hung up before when i tried this path because i was trying to set the variable to the value in the spreadsheet during the variables creation(which apparently can't be done) rather than setting the variable from within the keyword test (which works great).1.6KViews1like1CommentRe: Want a single log entry that prints a value from a spreadsheet AND a variable from the Keyword
Marsha, With this code expression: "Lens = " +KeywordTests.Sheet1.Variables.lens we did pull a variable from the Sheet1 keyword test for use in the TestCase1 keyword test so I tried using the following command from within Sheet1 keyword test and it did not work there either " Country = " + KeywordTests.Sheet1.Variables.CountryLanguageTestSet["Country"] This syntax seems to work when the log message is set to Table Data but not when it is set to Code Expression.1.6KViews0likes6CommentsRe: Want a single log entry that prints a value from a spreadsheet AND a variable from the Keyword
Ok, that did not work. Partly because the variable is from the Sheet1 keyword test while the log command we are working on is in the TestCase1 keyword test. I then edited it to be " Country = " + KeywordTests.Sheet1.Variables.CountryLanguageTestSet["Country"] and that also did not work. I attached screenshots of both code expressions in the entry box as well as the log with the exception line highlighted so you can see the error message associated with each code expression.2.1KViews0likes8Comments