Hello all,
i have a recording 'Recording1' with test variable 'var1' inside a smart folder 'testfolder' with simple data table of one column and 3 rows binded to 'var1'. my recording is running 3 times now - clicking on 'Next' button . how ever when it comes to 3 rd iteration i want to do something else . click on delete button instead of next button. i wrote a user code method to get the value of the iteration and click on delete button if iteration value = 3rd column value. i am getting an error " object reference not set to instance of the object".
in my user code the error is at line
string itrname = TestSuite.Current.GetTestContainer(TestSuite.CurrentTestContainer.Name.ToString()).DataContext.CurrentRow.Values.ToString();
please help on how to get the current data row value.
Thank you.
Get Current Test Iteration Variable Value in String()
Re: Get Current Test Iteration Variable Value in String()
Hi,
Try this code instead...
This code should return actual iteration number.
Try this code instead...
Code: Select all
string itrname = TestSuite.Current.GetTestContainer(TestSuite.CurrentTestContainer.Name).DataContext.CurrentRowIndex.ToString();
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: Get Current Test Iteration Variable Value in String()
Thank you sir, it is working i am also able to get the row data value now from this.
TestSuite.Current.GetTestContainer(TestSuite.CurrentTestContainer.Name).DataContext.CurrentRow.Values.GetValue(0).ToString()
TestSuite.Current.GetTestContainer(TestSuite.CurrentTestContainer.Name).DataContext.CurrentRow.Values.GetValue(0).ToString()