Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
General Run error
#1
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi,
This is my code :
Code:
Browser("name:=Browser").Page("title:=Browser").Link("name:=Link Name").Click
Set desc = Description.Create()
desc("alt").Value = "Edit"
desc("html tag").Value = "IMG"
desc("image type").Value = "Image Link"
desc("name").Value = "Image"
desc("file name").Value = "edit.gif"
Set List =Browser("name:=Browser").Page("title:=Browser").ChildObjects(desc)     
NoOfChildObjs =  List.Count()
msgbox  NoOfChildObjs
For  i = 0  to NoOfChildObjs - 1
List(i).Click
Next

The script is executing for the first iteration ie when i=0 and on the second iteration i am getting a General run error in the line List(i).click.

I am new to descriptive programming.
Can any body help me ?
Reply
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
Inside the loop
For i = 0 to NoOfChildObjs - 1
List(i).Click
Next
I guess mostly
1. after List(0).Click, application is navigating to some other screen OR
2. after this click action the child properties are changing, pls verify.
When you get this error, stop the test run and at this point use object spy to verify the child property if it is same as you have used while describing....for the 2nd possibility.
Reply
#3
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi,
I tried both the possibilities the child property is not getting chnged after the first iteration.
Is there any other option to do this?

by
Prema
Reply
#4
Solved: 11 Years, 3 Months, 3 Weeks ago
try by adding the micclass property in description
desc("micclass").value="Image"
Pls lemme know once done this
Reply
#5
Solved: 11 Years, 3 Months, 3 Weeks ago
Sorry Kavita still i am getting the error in that statement....
Reply
#6
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi Prema,
I tried the samething in my application, good news is that i am also getting the same error only if i attempt clicking that image.that means there is problem with properties of child/BrowserPage once we click for List(0).In my app, i have images with properties i have described below. This will display the name and file name(for me file names are different in my app). But if i add the line List(0).Click... will get the same error as u are getting now, From this we can understand that there is change in
Browser().Page(). -->> Pls look into this
Here i am pasting my script:
Code:
desc = Description.Create()
'desc("alt").Value = "Edit"                  
desc("html tag").Value = "IMG"
desc("image type").Value = "Image Link"
desc("name").Value = "Image"
'desc("file name").Value = "edit.gif"
Set List =Browser("title:=CFS - Search Trades").Page("title:=CFS - Search Trades").ChildObjects(desc)
' check Browser("title:=CFS - Search Trades").Page("title:=CFS - Search Trades")
NoOfChildObjs = List.Count()
msgbox NoOfChildObjs
For i = 0 to NoOfChildObjs - 1
'List(i).Click
MsgBox List(i).GetROProperty("name")
MsgBox List(i).GetROProperty("file name")
Next
Reply
#7
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi Kavita,
I thank u for ur effort and reply.
I agree with ur points.
The properties of the Browser().Page(). is getting changed.
I executed the script and stopped at the point where i got error then i used object spy to check the properties.
What i observed was
In the first iteration (ie List(0).click ) the object spy shows the property in the hierarcy
Browser->Page->WebTable1->WebTable2->WebTable3->WebTable4->Image:Edit

after the first iteration the object spy shows the property in the hierarcy
Browser->Page->WebTable1->WebTable2->WebTable3->WebTable4->WebTable5->Image:Edit

So i tried like this
For i = 0 to NoOfChildObjs - 1
Browser("name:=Browser").Page("title:=Browser").Link(name:=Link Name").Click ' to refresh the page
List(i).Click
Next

But still getting the same error.
Is there any other way to make click of the image.
Reply
#8
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi Prema here is the solution, the reason is "Object is losing its property after first click", i donno the exact cause, let us find it out later. Meanwhile try this script, this will work.

Code:
Browser("name:=Browser").Page("title:=Browser").Link("name:=Link Name").Click
Set desc = Description.Create()
desc("alt").Value = "Edit"
desc("html tag").Value = "IMG"
desc("image type").Value = "Image Link"
desc("name").Value = "Image"
desc("file name").Value = "edit.gif"
Set List =Browser("name:=Browser").Page("title:=Browser").ChildObjects(desc)
NoOfChildObjs = List.Count()
msgbox NoOfChildObjs
For i = 0 to NoOfChildObjs - 1
List(i).Click
Set List =Browser("name:=Browser").Page("title:=Browser").ChildObjects(desc)
Next
Reply
#9
Solved: 11 Years, 3 Months, 3 Weeks ago
Wow, Its working.
Thank u very much Kavita.

Regards
Prema.
Reply
#10
Solved: 11 Years, 3 Months, 3 Weeks ago
Smile WC Prema
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  General run error when Exist fails msacks 1 1,851 02-08-2019, 02:12 AM
Last Post: Ankur
  General Object Error(Find Object Error) akhandesh 1 3,597 02-24-2016, 01:05 PM
Last Post: sindhus
Rolleyes The test run cannot continue due to an unrecoverable error neerndg123 3 8,653 09-17-2015, 08:27 PM
Last Post: ananthakumarbe
  HI, i'm having a run time error ,please help? Awzar 0 2,633 01-24-2015, 06:52 AM
Last Post: Awzar
  Browser("BrowserName").Back gives General Run Error... deminiek 13 18,632 12-10-2013, 12:53 AM
Last Post: rizvia

Forum Jump:


Users browsing this thread: 1 Guest(s)