Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QTP throws error on web elements when Descriptive programing used.
#11
Not Solved
HI Raj,
I have move forwarded with your answer. Now I am able to store the "alt" Property of Yellow Icon in to Data table.
But QTP not clicking on the Yellow Icon Image.

I am using the following Code:

Code:
Dim MyConnection, ConnectionString

Set MyConnection = CreateObject("ADODB.Connection")
ConnectionString = "Provider=sqloledb; Data Source=Ramesh; Initial Catalog=midc390;User Id=sa;Password=sa@123"
MyConnection.Open(ConnectionString)

Set MyRecordSet = CreateObject("ADODB.Recordset")
MyRecordSet.ActiveConnection=MyConnection
MyRecordSet.Open(""Select ID, NumID from Costestimate as YellowIcon where ReqID= '"&p&"'")

If  MyRecordset.EOF <> True  Then
    DataTable.Value("YellowIcon") = MyRecordset.Fields("YellowIcon").Value
End If

Dim Imglink
Imglink = DataTable.Value("YellowIcon")

Browser("Information Management").Page("Information Management").Frame("Frame_\d").Image("alt:="&Imglink).Click

I Even tried the Below Code also:-

Code:
Set oDesc = Description.Create()
      oDesc("abs_x").Value = "830"
      oDesc("abs_y").Value = "305"
      oDesc("html tag").Value = "IMG"
      oDesc("file name").Value="yellow_arrow\.gif"
      oDesc("alt").Value="Imglink"

Browser("Information Management").Page("Information Management").Frame("Frame_\d").Image(oDesc).Click
Set oDesc = nothing

But I am Getting this Error:
Cannot identify the object "[ Image ]" (of class Image). Verify that this object's properties match an object currently displayed in your application.
Reply
#12
Not Solved
Code:
MyRecordSet.Open("Select ID, NumID from Costestimate as YellowIcon where ReqID= '" &p& "'")
Reply
#13
Not Solved Shy 
Hi Ankur,
Can you please help me in this. I am able to get the value => javascript:OpenEstimate(8770,1,2,3452) in to datatable and i stored the same in to a variable, But QTP not clicking on the Yellow Icon.
Getting the above mentioned error.
Reply
#14
Not Solved
Hi Ankur,
Can you provide any help in this? I am eagerly waiting.
Reply
#15
Not Solved
does the value which you get in datasheet after querying the db matches with what you see in alt properties of your image?

also in your earlier code I can see you have done wrongly
oDesc("alt").Value="Imglink"

it should be
oDesc("alt").Value=Imglink


Reply
#16
Not Solved
Hi Saket,
I changed the script as per your suggestion.
Still i am unable to click on Image

Code:
Code Changed as Below:
Set oDesc = Description.Create()
oDesc("abs_x").Value = "830"
oDesc("abs_y").Value = "305"
oDesc("html tag").Value = "IMG"
oDesc("alt").Value=Imglink
                
Browser("Works Information Management").Page("Works Information Management").Frame("Frame_\d").Image(oDesc).Click
Set oDesc = nothing

I even tried by removing double quotes for other properties also.

I am attaching the screen shot contains Application Information & the result

Any help is appreciated.


Attached Files Image(s)
   
Reply
#17
Not Solved
Hi,

I have a question, if the alt tag is unique for all the images, there is no need of giving their x and y co-ordinates.

Try by giving

Code:
Set oDesc = Description.Create()
oDesc("html tag").Value = "IMG"
oDesc("alt").Value=Imglink

Browser("Works Information Management").Page("Works Information Management").Frame("Frame_\d").Image(oDesc).Click
Reply
#18
Not Solved
Hello,

Frames create a lot of problem in object identification. I faced many myself untill i got a solution. And here it is, you don't need to use frames in your script. Just remove the frame from code as well as Object Repository.

e.g. use
Code:
Browser("Works Information Management").Page("Works Information Management").Image(oDesc).Click

Hope this solves your problem (atleast it did mine)

Regards,
Parminder
Reply
#19
Not Solved
HI Hariraman,
I followed the same steps as you mentioned, But it not worked.
But one thing i want to say alt property is not unique for all Yellow Icons.

Hi Parminder,
I shifted all the objects from frame to page in OR, Now all steps executed successfully but only the YellowIcon click step is not working.
I am getting the same error message as mentioned above.

I am also attaching the screen shot of New OR.


Attached Files Image(s)
   
Reply
#20
Not Solved
Hi,

In the Object spy on the previous page, i can see that image is in webtable. So i would suggest you to use childitem method in Webtable to click the image instead of creating description of image.

to do so>> add the webtable to your repository. take the rowcount. loop through rowcount and on the desired row, click on the image using childitem method.

please let me know if you face any problem in this approach.

Regards,
Parminder
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Descriptive programing kedala 1 2,747 10-04-2016, 09:25 PM
Last Post: venkatesh9032
Smile find out of spelling error in Web application deveshbhatt29 1 2,215 01-10-2014, 05:10 PM
Last Post: Maheep_bhambri
  Getting an 'Error in XML document' Error when submitting web services XML luckyexpert 0 3,128 08-20-2013, 10:23 PM
Last Post: luckyexpert
  Web Table Descriptive Language karraaruna 3 3,472 07-04-2013, 08:06 PM
Last Post: karraaruna
  Web Elements DL karraaruna 3 3,211 06-06-2013, 10:05 AM
Last Post: vinod123

Forum Jump:


Users browsing this thread: 1 Guest(s)