find a texblock object exist in the application
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2010
05:15 AM
08-03-2010
05:15 AM
find a texblock object exist in the application
We have a an object whose clrfullclassname is "System.Windows.Controls.TextBlock"
Question:
1. to which object shall I map this,(I mapped it to WPFEdit)
2. How do I find whether an object with name " "Segment A1 (12:28)" exists, following is the way I am doing. plz suggest
testobject.TextBlock( "Segment A1 (12:28)").exists
Question:
1. to which object shall I map this,(I mapped it to WPFEdit)
2. How do I find whether an object with name " "Segment A1 (12:28)" exists, following is the way I am doing. plz suggest
testobject.TextBlock( "Segment A1 (12:28)").exists
7 REPLIES 7
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2010
08:15 PM
08-03-2010
08:15 PM
Hi,
1. You don't need to map this object to any type of control. Work with it via its native properties and methods in the way you'd do this inside your application.
2. Inspect this object in the Object Browser and see what property has the needed value ("Segment A1 (12:28)"). Then, use the Find method (see the "Find Method" help topic) to search for the object by this property.
1. You don't need to map this object to any type of control. Work with it via its native properties and methods in the way you'd do this inside your application.
2. Inspect this object in the Object Browser and see what property has the needed value ("Segment A1 (12:28)"). Then, use the Find method (see the "Find Method" help topic) to search for the object by this property.
------
Yuri
TestComplete Customer Care Engineer
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Yuri
TestComplete Customer Care Engineer
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2010
02:11 AM
08-04-2010
02:11 AM
I checked the object in the object browser: The following properties have
Name = WPFObject("TextBlock", "Segment A1 (12:28)", 2)
Text = Segment A1 (12:28)
WPFControlText = Segment A1 (12:28)
So I am doing the following way.
1. setting
set mysegment = frmNewsPlexMDI.MdiClient.frmMocoContainer.splitContainer1.SplitterPanel.mocoHost.HwndSource_AdornerDecorator.AdornerDecorator.AvalonAdapter.main.dockMain.gridContent.gridMain.Viewbox.Grid.MocoPanel.header.Border.Grid
2. getting cordinates
leftcordinate = mysegment.TextBlock(WPFcontroltext = "Segment A1 (12:28)").screenleft
3. MsgBox(leftcordinate)
But I get the message saying non-existent object. please suggest the correct way to do.
Name = WPFObject("TextBlock", "Segment A1 (12:28)", 2)
Text = Segment A1 (12:28)
WPFControlText = Segment A1 (12:28)
So I am doing the following way.
1. setting
set mysegment = frmNewsPlexMDI.MdiClient.frmMocoContainer.splitContainer1.SplitterPanel.mocoHost.HwndSource_AdornerDecorator.AdornerDecorator.AvalonAdapter.main.dockMain.gridContent.gridMain.Viewbox.Grid.MocoPanel.header.Border.Grid
2. getting cordinates
leftcordinate = mysegment.TextBlock(WPFcontroltext = "Segment A1 (12:28)").screenleft
3. MsgBox(leftcordinate)
But I get the message saying non-existent object. please suggest the correct way to do.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2010
08:23 PM
08-04-2010
08:23 PM
Hi,
As I said in my previous post, use the Find method. The first parameter is "Text", the second one is "Segment A1 (12:28)". You can find an example in the "Find Method" help topic.
As I said in my previous post, use the Find method. The first parameter is "Text", the second one is "Segment A1 (12:28)". You can find an example in the "Find Method" help topic.
------
Yuri
TestComplete Customer Care Engineer
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Yuri
TestComplete Customer Care Engineer
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2010
05:19 AM
08-05-2010
05:19 AM
I am doing the following way but I still get saying the object does not exist. can you tell what may be wrong.
[FYI: the object I am trying find is something like this - WPFObject("TextBlock", "Segment A1 (12:28)", 2) ]
step 1
set mysegment = Sys.Process("NewsFlex").WinFormsObject("frmNewsPlexMDI").WinFormsObject("MdiClient", "").WinFormsObject("frmMocoContainer").WinFormsObject("splitContainer1").WinFormsObject("SplitterPanel", "", 2).WinFormsObject("mocoHost").WPFObject("HwndSource: AdornerDecorator", "elementHost1").WPFObject("AdornerDecorator", "", 1).WPFObject("AvalonAdapter", "", 1).WPFObject("main").WPFObject("dockMain").WPFObject("gridContent").WPFObject("gridMain").WPFObject("Viewbox", "", 1).WPFObject("Grid", "", 1).WPFObject("MocoPanel", "", 1).WPFObject("header").WPFObject("Border", "", 1).WPFObject("Grid", "", 1)
step2
set pobject = mysegment.Find("WPFControlText","Segment A1 (12:28)",20)
step3
msgbox(pobject.Name)
[FYI: the object I am trying find is something like this - WPFObject("TextBlock", "Segment A1 (12:28)", 2) ]
step 1
set mysegment = Sys.Process("NewsFlex").WinFormsObject("frmNewsPlexMDI").WinFormsObject("MdiClient", "").WinFormsObject("frmMocoContainer").WinFormsObject("splitContainer1").WinFormsObject("SplitterPanel", "", 2).WinFormsObject("mocoHost").WPFObject("HwndSource: AdornerDecorator", "elementHost1").WPFObject("AdornerDecorator", "", 1).WPFObject("AvalonAdapter", "", 1).WPFObject("main").WPFObject("dockMain").WPFObject("gridContent").WPFObject("gridMain").WPFObject("Viewbox", "", 1).WPFObject("Grid", "", 1).WPFObject("MocoPanel", "", 1).WPFObject("header").WPFObject("Border", "", 1).WPFObject("Grid", "", 1)
step2
set pobject = mysegment.Find("WPFControlText","Segment A1 (12:28)",20)
step3
msgbox(pobject.Name)
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2010
09:12 PM
08-05-2010
09:12 PM
Hi,
In which line do you get this error and what is the missing object (see the Remarks section of the error message in the log to figure this out)?
In which line do you get this error and what is the missing object (see the Remarks section of the error message in the log to figure this out)?
------
Yuri
TestComplete Customer Care Engineer
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Yuri
TestComplete Customer Care Engineer
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2010
01:26 AM
08-06-2010
01:26 AM
The error is in this line
set mysegment =
Sys.Process("NewsFlex").WinFormsObject("frmNewsPlexMDI").WinFormsObject("MdiClient",
"").WinFormsObject("frmMocoContainer").WinFormsObject("splitContainer1").WinFormsObject("SplitterPanel",
"", 2).WinFormsObject("mocoHost").WPFObject("HwndSource:
AdornerDecorator", "elementHost1").WPFObject("AdornerDecorator", "",
1).WPFObject("AvalonAdapter", "",
1).WPFObject("main").WPFObject("dockMain").WPFObject("gridContent").WPFObject("gridMain").WPFObject("Viewbox",
"", 1).WPFObject("Grid", "", 1).WPFObject("MocoPanel", "",
1).WPFObject("header").WPFObject("Border", "", 1).WPFObject("Grid", "",
1)
The object not found is "WPFControlText","Segment A1 (12:28)",20
set mysegment =
Sys.Process("NewsFlex").WinFormsObject("frmNewsPlexMDI").WinFormsObject("MdiClient",
"").WinFormsObject("frmMocoContainer").WinFormsObject("splitContainer1").WinFormsObject("SplitterPanel",
"", 2).WinFormsObject("mocoHost").WPFObject("HwndSource:
AdornerDecorator", "elementHost1").WPFObject("AdornerDecorator", "",
1).WPFObject("AvalonAdapter", "",
1).WPFObject("main").WPFObject("dockMain").WPFObject("gridContent").WPFObject("gridMain").WPFObject("Viewbox",
"", 1).WPFObject("Grid", "", 1).WPFObject("MocoPanel", "",
1).WPFObject("header").WPFObject("Border", "", 1).WPFObject("Grid", "",
1)
The object not found is "WPFControlText","Segment A1 (12:28)",20
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2010
07:21 PM
08-07-2010
07:21 PM
Hi,
What text do you see in the Remarks section of the error message you get (see the "Test Log Pages and Panels" help topic)?
What text do you see in the Remarks section of the error message you get (see the "Test Log Pages and Panels" help topic)?
------
Yuri
TestComplete Customer Care Engineer
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Yuri
TestComplete Customer Care Engineer
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
