How to check the alignment of Data inside the webTable?

145 views
Skip to first unread message

Lalit Aggarwal

unread,
Nov 1, 2013, 1:50:55 AM11/1/13
to mercu...@googlegroups.com
Hi All,

I need to check the alignment of all the data inside the webtable,
I am able to get the data from each row and column, but i am not able to get the RO property of any element (data) in side the webTable
Could anyone please help me in that?

Regards,
Lalit Aggarwal

Shantanu Joshi

unread,
Nov 2, 2013, 9:59:08 AM11/2/13
to mercu...@googlegroups.com
Hi Lalit,

I have some questions to ask you.
1. What do you want check by retreiving the RO property values.
2. What are the types of elements inside WebTable. i.e. WebElement,Link etc.

I can help you with this if you let me know answers of the questions above.

Enjoy Automation,
Shantanu

Lalit Aggarwal

unread,
Nov 2, 2013, 11:42:38 AM11/2/13
to mercu...@googlegroups.com, joshi.sh...@gmail.com
Hi Shantanu,

Thanks for reply,

Here are the answers of your questions
1. What do you want check by retreiving the RO property values?
Ans: Actually we need to check the alignment of Data present there in webtable, so i was thinking to get "outertext" property or some other property, still i could not find exact answer to how to check the alignment of data (webelements) just i am trying it? if you've any idea to check the alignment of all webelements present in webtable, please share me.

2. What are the types of elements inside WebTable. i.e. WebElement,Link etc.

Ans : All are WebElements.

I hope now picture is crystal clear to you.

Regards,
Lalit Aggarwal
9900329906


--
--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to Mercu...@googlegroups.com
To unsubscribe from this group, send email to
MercuryQTP+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en
 
---
You received this message because you are subscribed to the Google Groups "QTP - HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mercuryqtp+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Shantanu Joshi

unread,
Nov 3, 2013, 5:07:05 AM11/3/13
to mercu...@googlegroups.com

Hi Lalit,

Let me wish you first Happy Diwali :).

Now answer to your problem can be as below:

If all are webelements inside the table then you can use Object.object property of an object in QTP.

You can retrieve the webelement of the WebTable and use its Object property which provides you access to use DOM properties of the any webelement.

This following example will help you understand this.

Create an html file with below code:

<html> <head> <style type="text/css"> h1 { text-align:center; } p.date { text-align:right; } p.main { text-align:justify; } </style>

</head>

<body> <h1>CSS Align test</h1> <p class="date">May, 2009</p> <p class="main">In my younger and more vulnerable years my father gave me some advice that I've been turning over in my mind ever since.</p> <p><b>Note:</b> Try to resize the browser window to see how justify works.</p> </body>

</html>

Open the html file and then add the objects to OR.

Associate this with script.

Now in script call below statement.

MsgBox Browser("").Page(""). WebElement("html tag:=P", "innertext:=May, 2009").Object.CurrentStyle.textAlign

This will display the alignment.

Thank you!!!

Regards, Shantanu



On Friday, 1 November 2013 11:20:55 UTC+5:30, Lalit Aggarwal wrote:
Reply all
Reply to author
Forward
0 new messages