This question is locked. New answers and comments are not allowed.
Hi,
I'm having problem when i tried to convert my recorded test to NUnit. The test is running fine when i run it from aii file. However, when i converted the test into NUnit, the test failed. My test is selecting item from the drop down and check whether some text appear in the label. There are 3 items in the drop down list and the label will change accordingly when different item is selected from the drop down list. For exmaple, i can choose country(singapore, malaysia, indonesia) from the drop down list and i'll see the country that has been chosen in the label. I need to create a test which when i select the country from the drop down, check whether the label contain some correct country name. The test passed in for the 1st time and always failed in the 2nd iteration. The error i get is the actual string doesn't match with the expected string, where the actual string is always the first string i choose.
Here is the codes of my test
I'm having problem when i tried to convert my recorded test to NUnit. The test is running fine when i run it from aii file. However, when i converted the test into NUnit, the test failed. My test is selecting item from the drop down and check whether some text appear in the label. There are 3 items in the drop down list and the label will change accordingly when different item is selected from the drop down list. For exmaple, i can choose country(singapore, malaysia, indonesia) from the drop down list and i'll see the country that has been chosen in the label. I need to create a test which when i select the country from the drop down, check whether the label contain some correct country name. The test passed in for the 1st time and always failed in the 2nd iteration. The error i get is the actual string doesn't match with the expected string, where the actual string is always the first string i choose.
Here is the codes of my test
// Click 'LblSiteSelectedLink'
Pages.FactoryPlanningSystem.LblSiteSelectedLink.Click(
false
);
// RadComboBoxItem(''): selecting item 'Suz'
Pages.FactoryPlanningSystem_0.SuzListItem.Select();
// Wait for 'TextContent' 'Contains' 'Suzhou' on 'LblSiteLargeSpan'
HtmlSpan LblSiteLargeSpan = Pages.FactoryPlanningSystem.LblSiteLargeSpan;
Wait.For<HtmlSpan>(c => c.AssertContent().TextContent(ArtOfTest.Common.StringCompareType.Contains,
"Suzhou"
), LblSiteLargeSpan, 10000);
// Click 'LblSiteSelectedLink'
Pages.FactoryPlanningSystem.LblSiteSelectedLink.Click(
false
);
// RadComboBoxItem(''): selecting item 'Png'
Pages.FactoryPlanningSystem_0.PngListItem.Select();
// Wait for 'TextContent' 'Contains' 'Png' on 'LblSiteLargeSpan'
Wait.For<HtmlSpan>(c => c.AssertContent().TextContent(ArtOfTest.Common.StringCompareType.Contains,
"Penang"
), LblSiteLargeSpan, 10000);
The test will always fail at this step with the error meesage that i attached. Theactual string will always be Suzhou.
Pls help.