This is a migrated thread and some comments may be shown as answers.

Width of an table

8 Answers 59 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 16 May 2013, 03:35 PM
Hoe do i get the width of an dynamic created table?

In Coded Step i do find the element with
            HtmlTable resultTable = Find.ByExpression<HtmlTable>("name=aspnetForm","|","TagName=table","id=~cmsWebControlContainer");

But resultTable.width returns nothing. 
resultTable.GetComputedStyle("width").Value return "auto"?

So, how can i get the real width?

8 Answers, 1 is accepted

Sort by
0
Boyan Boev
Telerik team
answered on 17 May 2013, 12:55 PM
Hi Michael,

If the width is set to "auto" then this is expected behavior in Internet Explorer. Even if it is not set to "auto", the default value in Internet Explorer is "auto".

To get the actual width you should use table's rectangle. It has width property which returns the actual number instead of "auto":

using System.Drawing;

HtmlTable resultTable = Find.ByExpression<HtmlTable>(
"name=aspnetForm","|","TagName=table","id=~cmsWebControlContainer");
 
System.Drawing.Rectangle rect= resultTable.GetRectangle();
Log.WriteLine(rect.Width.ToString() + "px");

Note that you should add System.Drawing reference assembly.

Let me know if this helps. 

Greetings,
Boyan Boev
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Michael
Top achievements
Rank 1
answered on 17 May 2013, 01:48 PM
Thanks, that works .
0
Boyan Boev
Telerik team
answered on 17 May 2013, 02:29 PM
Hi Michael,

I am glad I could help.
 
Please don't hesitate if you have additional questions.  


Greetings,

Boyan Boev
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
John
Top achievements
Rank 2
answered on 06 Dec 2014, 03:12 PM
Hi, I read this post as I'm getting wired with coffee (Warning I'm wired, proceed with extreme caution!), a question came to mind.  During recording can we do the following, and how:
1) High light the area during play back.
2) Take an image of the area and save it as a file?
3) Have it make more coffee (just kidding!)

thanks,
John
0
John
Top achievements
Rank 2
answered on 06 Dec 2014, 03:16 PM
Hi, I read the post and came up with a few questions, and how we can do them.:
1) Can we have the highlight come up of the object during playback?
2) Can we take an image of the object in the rectangle.

just a few thoughts,
thanks,
John
0
Boyan Boev
Telerik team
answered on 10 Dec 2014, 12:24 PM
Hi John,

During the playback Test Studio can highlight the elements which it interacts with. Please turn on the annotations to achieve this. See this article for more information.

Regarding the second question please see this KB.

Hope this helps.

Regards,
Boyan Boev
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
John
Top achievements
Rank 2
answered on 10 Dec 2014, 02:36 PM
Thank you for your reply, however; your showing me the on/off switch to highlight all objects under gods green earth.  What I'm asking is the same functionality as in Microsoft coded UI the DrawHighlight method, where we can of the object found highlighted.  Below are example's of this being done in MS Coded UI, and I was asking how this can be done in Telerik? 

Thanks,
John

Marcel de Vries / Pluralsight Course
http://www.pluralsight.com/courses/transcript/codedui-test-automation / Visual Debug Playback

Coded UI highlight controls DrawHighlight
https://social.msdn.microsoft.com/Forums/en-US/122affb3-16e7-4270-97e9-a3016de887bd/coded-ui-highlight-controls-drawhighlight?forum=vstest
0
Boyan Boev
Telerik team
answered on 15 Dec 2014, 08:38 AM
Hello John,

You can use our Visual Debugger which is very helpful tool for troubleshooting. Please see this article

You can also highlight a particular element via "Edit in Live" function.

Hope this helps.

Regards,
Boyan Boev
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Michael
Top achievements
Rank 1
Answers by
Boyan Boev
Telerik team
Michael
Top achievements
Rank 1
John
Top achievements
Rank 2
Share this question
or