This question is locked. New answers and comments are not allowed.
I have a page the displays a panel this an updatepanel inside it.
this panel has a link called check status where the user will click this link to check on the cuurent status of the file conversion to pdf, then the conversion is complete the user will be redirected to the preview screen.
so basicly I need the tester to wait on this panel till the coversion is complete before preceding
any help would be appreciated
this panel has a link called check status where the user will click this link to check on the cuurent status of the file conversion to pdf, then the conversion is complete the user will be redirected to the preview screen.
so basicly I need the tester to wait on this panel till the coversion is complete before preceding
any help would be appreciated
3 Answers, 1 is accepted
0
Hello Andrew,
Let me see if I understand correctly... you have a want to craft a test in which:
1) A file is uploaded intended to be converted to PDF
2) After the upload is complete nothing is updated on the screen to indicate the progress or completion of the conversion. The display remains static.
3) A link must be clicked to get the status of the conversion. If not done, some sort of "in progress message" is returned.
4) When the conversion is done the preview of the conversion is displayed instead of the "in progress message".
5) The WebAii test must repeatedly perform step 3 until step 4 is returned.
Do I have that sequence correct?
Implementing a looped wait for like this must be implemented in code. I would tackle this by
Best wishes,
Cody
the Telerik team
Let me see if I understand correctly... you have a want to craft a test in which:
1) A file is uploaded intended to be converted to PDF
2) After the upload is complete nothing is updated on the screen to indicate the progress or completion of the conversion. The display remains static.
3) A link must be clicked to get the status of the conversion. If not done, some sort of "in progress message" is returned.
4) When the conversion is done the preview of the conversion is displayed instead of the "in progress message".
5) The WebAii test must repeatedly perform step 3 until step 4 is returned.
Do I have that sequence correct?
Implementing a looped wait for like this must be implemented in code. I would tackle this by
- Recording clicking on the link.
- Record a verification of the "In progress" message.
- Convert steps 1 & 2 to code.
- Merge the two coded steps into one and wrap them in a loop.
- Make the loop simply exist when the verification step fails... don't let it throw an exception which will cause the test to abort.
Best wishes,
Cody
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0
Andrew
Top achievements
Rank 1
Veteran
Iron
answered on 23 Sep 2010, 01:13 PM
I actually got it to work, I did a do while loop untill I got a 'completed' status it the conversion status label,
I had to make a call th the thread sleep method to slow the loop down but it all worked in the end.
here is my code:
if you have any suggestions I would love to hear them
I had to make a call th the thread sleep method to slow the loop down but it all worked in the end.
here is my code:
HtmlSpan lblConversionStatus = Find.ById<HtmlSpan>("ctl00_ContentPlaceHolder1_ElectronicSubmission1_emCheckPDFStatus_lblConversionStatus");
lblConversionStatus.Wait.ForVisible(1200000); //120 sec
do
{
System.Threading.Thread.Sleep(new TimeSpan(0, 0, 5));
Pages.EZoneResumePack.ContentPlaceHolder1ElectronicSubmission1EmCheckPDFStatusLinkButton1Link.Click(false);
lblConversionStatus = Find.ById<HtmlSpan>("ctl00_ContentPlaceHolder1_ElectronicSubmission1_emCheckPDFStatus_lblConversionStatus");
}
while (lblConversionStatus.TextContent.ToUpper() != "COMPLETE");
if you have any suggestions I would love to hear them
0
Hello Andrew,
That actually looks pretty good! I'll offer some suggestions for you to optimize it a bit more.
These two lines of code can be easily replaced by a standard Wait.ForVisible step. You can add such a step via the DOM explorer. See this training video on how to do this. Once you do that you'll have a new Pages.EZoneResumePack.<something> to use in place of lblConversionStatus in the rest of the code.
Next I would add a timeout using a StopWatch and a check for timeout like this:
I made a couple of other very minor code tweaks you'll probably pick up on.
Greetings,
Cody
the Telerik team
That actually looks pretty good! I'll offer some suggestions for you to optimize it a bit more.
HtmlSpan lblConversionStatus = Find.ById<HtmlSpan>(
"ctl00_ContentPlaceHolder1_ElectronicSubmission1_emCheckPDFStatus_lblConversionStatus"
);
lblConversionStatus.Wait.ForVisible(1200000);
//120 sec
These two lines of code can be easily replaced by a standard Wait.ForVisible step. You can add such a step via the DOM explorer. See this training video on how to do this. Once you do that you'll have a new Pages.EZoneResumePack.<something> to use in place of lblConversionStatus in the rest of the code.
Next I would add a timeout using a StopWatch and a check for timeout like this:
Stopwatch sw =
new
Stopwatch();
sw.Start();
do
{
System.Threading.Thread.Sleep(5 * 1000);
// Sleep for 5 seconds
Pages.EZoneResumePack.ContentPlaceHolder1ElectronicSubmission1EmCheckPDFStatusLinkButton1Link.Click(
false
);
lblConversionStatus = Find.ById<HtmlSpan>(
"ctl00_ContentPlaceHolder1_ElectronicSubmission1_emCheckPDFStatus_lblConversionStatus"
);
}
while
(!lblConversionStatus.TextContent.Equals(
"complete"
, StringComparison.InvariantCultureIgnoreCase) &&
sw.ElapsedMilliseconds < 5 * 60 * 1000);
// Wait 5 minutes for conversion complete
Assert.IsTrue(lblConversionStatus.TextContent.Equals(
"complete"
, StringComparison.InvariantCultureIgnoreCase),
"Time out occurred waiting for conversion to complete"
);
I made a couple of other very minor code tweaks you'll probably pick up on.
Greetings,
Cody
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items