How to set a test case parameter value using user code
-
- Posts: 5
- Joined: Wed Oct 11, 2017 10:37 am
How to set a test case parameter value using user code
[img]Untitled.png[/img]
- Attachments
-
- Untitled.png (23.03 KiB) Viewed 2300 times
Re: How to set a test case parameter value using user code
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
-
- Posts: 5
- Joined: Wed Oct 11, 2017 10:37 am
Re: How to set a test case parameter value using user code
Hi @odklizec I've tried to use the code
so the code update just for that recording but when it goes to the next step it goes back again so here are some pics for more details
and this is the result of the next step as you can see "in bold case" the parameter that it used is still the old one and not the one updated by the user code
WaitForAttributeEqual failed. Element for item 'NSSRepository.NSS.ScreeningEvents.NationalScreeningSystem.Title.ScreeningEvents' does not exist (Failed to find item 'NSSRepository.NSS.ScreeningEvents.NationalScreeningSystem.Title.ScreeningEvents'. No element found for path '/dom[@domain='portaltest.extra.nehr.sg']//iframe[#'PegaGadget0Ifr']//div[#'HARNESS_CONTENT']/table//div[@id='RULE_KEY']//?/?/div[@innertext='Screening Events']' within 1m.).
Show/Hide Stacktrace
Code: Select all
aiFrameCtr = aiFrameCtr + 1; //Counter
string iFrameXpathTemporary = "PegaGadget{0}Ifr"; //Template
string iFrameXpathTemporary2 = string.Format(iFrameXpathTemporary , aiFrameCtr); //combining iFrameCtr and TemporaryXpath
string ConvertiFrameCtr = aiFrameCtr.ToString();
aiFrameXpath = iFrameXpathTemporary2; //Final xPath
TestSuite.CurrentTestContainer.Parameters["iFrameXpath"] = aiFrameXpath;
TestSuite.CurrentTestContainer.Parameters["iFrameCtr"] = ConvertiFrameCtr;
Report.Log(ReportLevel.Info, TestSuite.CurrentTestContainer.Parameters["iFrameXpath"]);
Report.Log(ReportLevel.Info, aiFrameXpath);
Report.Log(ReportLevel.Info, TestSuite.CurrentTestContainer.Parameters["iFrameCtr"]);
WaitForAttributeEqual failed. Element for item 'NSSRepository.NSS.ScreeningEvents.NationalScreeningSystem.Title.ScreeningEvents' does not exist (Failed to find item 'NSSRepository.NSS.ScreeningEvents.NationalScreeningSystem.Title.ScreeningEvents'. No element found for path '/dom[@domain='portaltest.extra.nehr.sg']//iframe[#'PegaGadget0Ifr']//div[#'HARNESS_CONTENT']/table//div[@id='RULE_KEY']//?/?/div[@innertext='Screening Events']' within 1m.).
Show/Hide Stacktrace
Re: How to set a test case parameter value using user code
If you change the value of a TestCase parameter, the value will be changed in the next TestCase.
Hope that helps.