Script Execution Issues

Class library usage, coding and language questions.
dal
Posts: 72
Joined: Thu Jun 24, 2010 8:59 am

Script Execution Issues

Post by dal » Wed Sep 29, 2010 1:59 pm

Hi Team,

Here there are couple of issues observed:

1. I have 4 different VB File called from Main method.

There are times all 4 will run successfully one after another, at times 2 or 3 or someother randomly failed though all the precondition for execution is similar for 4 success case.

Any suggestions to overcome this behavior. (this happens very randomly)

2. I have a Function which does two actions (mean in two different pages).

If I run this function the expected will be to run both the actions under a Function should run fine without any issue. But the second action is not running once the first action is over. If I comment out the first action then I run it, the second one runs fine. This happens everytime. I don't have a clue how to overcome this.

Kindly suggest some inputs...

Regards,
Dal...

User avatar
Ciege
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Script Execution Issues

Post by Ciege » Wed Sep 29, 2010 3:45 pm

Can you comment about the (any) errors you get when things do not run properly?
Maybe you are not waiting for objects to become active before trying to do some work? Try putting in code that waits for existence and readiness of objects (not just hard wait times).

There are lots of things that could be the problem. If we know that your code does work at times that means your steps are probably correct but the supporting code of how you get there needs fine tuning.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

dal
Posts: 72
Joined: Thu Jun 24, 2010 8:59 am

Re: Script Execution Issues

Post by dal » Fri Nov 12, 2010 6:51 am

Team,

Here is again we are facing some script execution issues, if we are running huge list of scripts (about 230 plus test scenarios) which will have to run for about 6 - 7 Hrs continously.

Mostly the issues observed in synchronization.

Script play-back is not waiting for the objects to be loaded before perform any operation on to it.

For E.g. I need to click on the "Cancel" button on the Web Page, once its displayed on the screen. I have given the Timeout for that object is 20sec. So my expectation is, script should wait for the max of 20 secs and perform operation on to it, but its not waiting.

There are cases it works fine, but there are cases the cursor is moving to the Top Left Cornor of the Web Page even the object is appeared on the Web Page.

We have done many things to tackle the issue, but fail to do it effectively... Any suggestions please....

Following are the Scripting Snippet have been used to handle the Sync... (given in bit by bit)

Section - 1
Keyboard.DefaultKeyPressTime = 100
Mouse.DefaultClickTime = 100
Mouse.DefaultMoveTime = 0
Delay.SpeedFactor = 2.0

Section - 2
Do
Loop Until Object.InnerText.Contains("Cancel")

Section - 3
Delay.Seconds (5)

Section - 4
Object.Self.WaitForDocumentLoaded

And another issue observed is ... I have a For Loop which I want to execute for say 5 times, Its able to perform the operation by identifying the Objects inside the loop for 3 times comfortably, for the 4 time its not able to identify few objects though it appeared on a WebPage. Don't know where the issue is happening...

Really it looks very strange to me.

Regards,
Dal...

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Script Execution Issues

Post by Support Team » Mon Nov 15, 2010 3:02 pm

Hi Dal,

We recommend our customers specially for web pages to turn of the Caching setting and set the timeout to 30 seconds for the elements. The first issue sounds similar to following post http://www.ranorex.com/forum/confusing- ... t1784.html
And for the second issue, maybe turn off the cache would solve it.

Turn of caching

Regards,
Peter
Ranorex Team