Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GetROProperty returns unexpected value
#1
Not Solved
Hi!
I have a next question. I'd like to get an dynamic value from a webpage and then place it in in a serch field. So I am using the next:
Code:
UW_nummer = DataTable("UW_nummer", Global)=Browser("PegaRULES Process Commander").Page("PegaRULES Process Commander").Frame("FORMFRAME").WebElement("htmlTag:=TD","abs_x:=2097","abs_y:=389").GetROProperty("outertext")
msgbox UW_nummer
Browser("PegaRULES Process Commander").Page("PegaRULES Process Commander").Frame("leftFrame").WebEdit("WebEdit").Set UW_nummer
I am expecting then the value that is shown at this time in that webelement. But the search field is filled with the value "False" instead. It seams that QTP dont see the value in this elemen.
I've tryed also the next: GetROProperty("innertext"); WebTable instead WebElement, but result is still the same. I send some screenshots of situation.

Thanx.


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

Never use co-ordinates as a description for your object.

Please add the object to Reporsitory and use regular expression.. finally u can use the below code..

Code:
'Get the value
UW_Number=Browser("PegaRULES Process Commander").Page("PegaRULES Process Commander").Frame("FORMFRAME").WebElement(<Name of the Object addedd to repository>).GetROProperty("innertext")

'Set the value
Browser("PegaRULES Process Commander").Page("PegaRULES Process Commander").Frame("leftFrame").WebEdit("WebEdit").Set UW_Number

Do let me know if u have any query.

Regards,
Ankesh
Reply
#3
Not Solved
Try this,
Code:
UW_nummer = DataTable("UW_nummer", Global)=Browser("PegaRULES Process Commander").Page("PegaRULES Process Commander").Frame("FORMFRAME").WebElement("htmlTag:=NOBR","abs_x:=2102","abs_y:=389").GetROProperty("outertext")
msgbox UW_nummer
Regards,
Ravi
Reply
#4
Not Solved
Hi Ankesh,

Thank you for your reaction.
That is what I done:
1. Used WebTable instead of WebElement.
2. Changed the coordinates. I have to use them because the name of the element is not unique.
3. Changed 'outertext" to "innertext".
The result is still the same.

Thanks for your reaction as well, Ravi.Gju. Unfortunately it did not work either.

This is the code I am trying to use now:
Code:
    UW_nummer = DataTable("UW_nummer", Global)=Browser("PegaRULES Process Commander").Page("PegaRULES Process Commander").Frame("FORMFRAME").WebTable("htmlTag:=TABLE","abs_x:=1918","abs_y:=363").GetROProperty("innertext")  
    msgbox UW_nummer
And this is the result (see the screen with mesgbox).
Please look at the Run screen shoot as well (Onwaar = False in Dutch language Smile ). What is also funny - in the search field I am getting value False - in English!
May be you have other suggestions?


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

Try this :
Code:
Set oDesc=Description.Create()
oDesc("micclass").value="WebTable"
oDesc("class").value="repeatReadOnly"

Set objColl=Browser().Page().Frame().ChildObjects(oDesc)

cnt_tb=objColl.count

For i=1 to cnt_tb
    no_cols=objColl.item(i).getroproperty("cols")
    If no_cols=2 Then
         data_tab=objColl.item(i).getcelldata(<row no>,<put here the column number in which ur data appear>)
        msgbox data_tab
    End If
Next
Reply
#6
Not Solved
Thank your for your help, parminderdhiman84.

I did as you advised:
Code:
Set oDesc=Description.Create()
oDesc("micclass").value="WebTable"
oDesc("class").value="repeatReadOnly"
Set objColl=Browser("PegaRULES Process Commander").Page("PegaRULES Process Commander").Frame("FORMFRAME").ChildObjects(oDesc)

cnt_tb=objColl.count
For i=1 to cnt_tb
no_cols=objColl.item(i).getroproperty("cols")
If no_cols=2 Then
data_tab=objColl.item(i).getcelldata(3,2)
msgbox data_tab
End If
Next
Unfortunately I've get an error message (see screenshot).
Probably I did something wrong...



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

Please try replacing the above For Loop with one of the following for loops. One of them should work for u:

Code:
For i=0 to cnt_tb-1
no_cols=objColl.item(i).getroproperty("cols")
If no_cols=2 Then
data_tab=objColl.item(i).getcelldata(3,2)
msgbox data_tab
End If
Next

or
Code:
For i=0 to cnt_tb-1
no_cols=objColl(i).getroproperty("cols")
If no_cols=2 Then
data_tab=objColl(i).getcelldata(3,2)
msgbox data_tab
End If
Next

or

Code:
For i=1 to cnt_tb
no_cols=objColl(i).getroproperty("cols")
If no_cols=2 Then
data_tab=objColl(i).getcelldata(3,2)
msgbox data_tab
End If
Next

If still the error comes then could u debug to check that "cnt_tb" is returning any value or not.
Reply
#8
Not Solved
Code:
Set oDesc=Description.Create()
oDesc("micclass").value="WebTable"
oDesc("class").value="repeatReadOnly"
Set objColl=Browser("PegaRULES Process Commander").Page("PegaRULES Process Commander").Frame("FORMFRAME").ChildObjects(oDesc)

cnt_tb=objColl.count
If (cnt_tb > 0) Then 'checking to see if the objColl.count > 0
  For i=1 to cnt_tb
    no_cols=objColl.item(i).getroproperty("cols")
    If no_cols=2 Then
      data_tab=objColl.item(i).getcelldata(3,2)
      msgbox data_tab
    End If
Next
End If

Try by adding other properties :
Code:
oDesc(<other property>).value=<property value>

till you get cnt_tb > 0 i.e. objColl.count > 0
Reply
#9
Not Solved
Thanx a lot, parminderdhiman84!

It works perfect now.
I used the first loop, only changing the row number.

Code:
For i=0 to cnt_tb-1
no_cols=objColl.item(i).getroproperty("cols")
If no_cols=2 Then
data_tab=objColl.item(i).getcelldata([b]2[/b],2)
msgbox data_tab
End If
Next

You saved my day Smile .
Reply
#10
Not Solved
Hi parminderdhiman84.

Any idea as to why it was giving "onwaar" as the output.

Regards,
Ravi
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)