Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unable to get text from Web page
#1
Solved: 11 Years, 3 Months, 3 Weeks ago
I am using web application developed in .Net in that after filling an application and sending i will get a unique number.
I want to take that number from the web page and search for application with the desired number with another login.
But Unable to do the same.

I used this code to get the Number.

Code:
x=Browser("AutoDCR").Page("B u i l d i n g P l a").Frame("contents_3").GetROProperty("outertext")
MsgBox x
I also Used the below code

Code:
DataTable.Value("ApplicationNumber",dtlocalsheet)= Browser("AutoDCR").Page("B u i l d i n g P l a").Frame("contents_3").GetROProperty ("innertext")
MsgBox DataTable.Value("ApplicationNumber",dtlocalsheet)

But I am unable to get the number in message box.

PFA Screen shot
Please help me ASAP


Attached Files Image(s)
   
Reply
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi Ramesh,

What I can see from the screenshot is, there is a WebTable under the frame.

I would suggest you to apply a standard checkpoint in that WebTable(and it becomes a Table Checkpoint). There you'll get see the unique number residing in a particular cell. Then you can use WebTable("").GetCellData(row,col) to retrieve the unique number.

Process to check the WebTable content

Quote:1.Click on the "Record" button (Record and Run on open browser)
2.Click F12 or click on insert standard checkpoint
3.Click over the unique number
4.A window will appear showing the hierachy
5.Click on the "WebTable" option

Now you will see the contents of the WebTable

Hope this will help you.

Let me know your further proceedings on this.
Reply
#3
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi,
the reason you are not able to get any value is coz the frame is dynamic in nature. First you need to handle the frame properties in you repository. Then the code mentioned above will not capture the webelement you are trying to get, coz you are trying to get the outertext value from the entire frame. So your code should look like this:

Code:
Set oDesc = Description.Create()
oDesc("html id").Value = "lblError"
oDesc("html tag").Value = "SPAN"
x = Browser("AutoDCR").Page("B u i l d i n g P l a").Frame("contents_3").Webelement(oDesc).GetROProperty("outertext")
MsgBox x
Set oDesc = nothing

If you need to use additional properties, use it to make your search more unique.

Hope this helps
Thanks
MV
Reply
#4
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi Thank You for the Reply
The problem solved with the below code

Code:
Set oDesc = Description.Create()
oDesc("html id").Value = "lblError"
oDesc("html tag").Value = "SPAN"
x = Browser("AutoDCR").Page("B u i l d i n g P l a").Frame("contents_3").Webelement(oDesc).GetROProperty("outertext")
MsgBox x
Set oDesc = nothing

I got the text from Row3 & Col1 using standard Check point
I used Replace & mid functions to get the correct one.

thanks for both of you.

But please help me on how to handle the frame as name changes from Frame(Contents_2), Contents_3...etc
I want to maintain a common repository through out the script by keeping all objects in Contents. Actually i moved all the objects from Contents_2 & 3 in to Contents and changed the code also, but this is not working in run time
Reply
#5
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi Nistalaramesh,

Use regular expression: Contents_.*
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Can QTP handle slick grid table in a web page qtplearner88 2 4,491 10-01-2019, 10:44 AM
Last Post: shilpi952
  unable to rowcount in web table manoj84monu 1 2,901 06-13-2016, 04:46 PM
Last Post: Anu1234
  DP Web Browser/Page issues rstimers 1 2,435 08-14-2015, 12:37 PM
Last Post: venkatesh9032
Question Capture Entire Web page through QTP learnQtptips 2 11,918 07-25-2013, 05:24 PM
Last Post: vinod123
  Unable to click on moving text in a website Akhila 4 4,005 07-18-2013, 02:38 PM
Last Post: tanyamrz

Forum Jump:


Users browsing this thread: 1 Guest(s)