Searching for text
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2010
06:25 AM
02-02-2010
06:25 AM
Searching for text
I'm searching for an effecient way to look at the loaded page and search for some text, specifically the text one can expect if the page returns a javascript error or finds no matching documents, which the developers have made global. The trouble is I can not predict exactly where it'll be on the page. I've tried using an if .... exists statement, but then I get a bunch of errors as its trying to find the frame I typically see the text appearing in which isn't there if the page does load/present documents properly, if that makes sense. My next thought was FindAllChildren, but then I'd find myself looking at an array, which I guess is possible, but seems cludgey somehow. Any thoughts?
TIA - Dave
Got the findallchildren logic working, but still seems cludgey
TIA - Dave
Got the findallchildren logic working, but still seems cludgey
37 REPLIES 37
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2010
11:50 PM
07-01-2010
11:50 PM
Hi Muhammad,
Thanks for sending the code. The script I sent before works with this HTML without problems:
Sub Test
Set page = Sys.Process("iexplore").Page("*")
Set obj = page.FindChild("innerText","CON*",100)
obj.Click
End Sub
If this script does not work for you, probably, scripts on your page modify them, and this modification is not made in the HTML code you posted. In this case, could you please post here an image of the tested page with the object you want to click highlighted?
A page object does not have this property indeed, but the code I sent worked with another object: page.Application.Document.getElementsByTagName("html")(0).
Secondly Page does not have the OuterHTML property, all the objects are under a Panel so i have posted Panel OuterHTML.
--
Dmitry Nikolaev
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Dmitry Nikolaev
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
07-04-2010
05:21 PM
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2010
06:55 PM
07-04-2010
06:55 PM
Hi Mazhar,
Thanks for sending the code. I tried to execute the script I sent in my previous post, and it worked fine for this page:
Sub Test
Set page = Sys.Process("iexplore").Page("*")
Set obj = page.FindChild("innerText","CON*",100)
obj.Click
End Sub
Please confirm that this code does not work for you. If it does not work, please let me know the exact text of the error posted to the test log.
--
Dmitry Nikolaev
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Dmitry Nikolaev
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
07-05-2010
12:12 AM
07-05-2010
12:12 AM
Hi David,
I am getting "There was an attempt to perform an operation ......................."
Remarks:
Sys.Process("iexplore").Page("http://ae001vm0131/JanusV2.3Paris/P4100/wfrm_S4112_10_InitialMainBudget.aspx?actionID=AMS4112_10_Ini..., 0).Table(0).Cell(0, 0).Table(0).Cell(0, 0).Table(0).Cell(0, 0).Panel("Expended").Table(0).Cell(1, 0)
Regards,
I am getting "There was an attempt to perform an operation ......................."
Remarks:
Sys.Process("iexplore").Page("http://ae001vm0131/JanusV2.3Paris/P4100/wfrm_S4112_10_InitialMainBudget.aspx?actionID=AMS4112_10_Ini..., 0).Table(0).Cell(0, 0).Table(0).Cell(0, 0).Table(0).Cell(0, 0).Panel("Expended").Table(0).Cell(1, 0)
Regards,
-
Muhammad Mazhar Mahmood
Certified Software Tester (CSTE)
Muhammad Mazhar Mahmood
Certified Software Tester (CSTE)
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2010
12:38 AM
07-05-2010
12:38 AM
Hi David,
I have further analyze the same problem, as i told you in my previous post it was showing "There was an attempt......" error message, my script was considering a wrong object as another object has innerText as "Conversion Table", to avoid this i have changed the string from CON to CONXXXXX in my application, now i am getting Object Not Found Error.
Regards,
I have further analyze the same problem, as i told you in my previous post it was showing "There was an attempt......" error message, my script was considering a wrong object as another object has innerText as "Conversion Table", to avoid this i have changed the string from CON to CONXXXXX in my application, now i am getting Object Not Found Error.
Regards,
-
Muhammad Mazhar Mahmood
Certified Software Tester (CSTE)
Muhammad Mazhar Mahmood
Certified Software Tester (CSTE)
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2010
03:05 AM
07-07-2010
03:05 AM
Hi Mazhar,
In this case, try searching by two properties:
Sub Test
Set page = Sys.Process("iexplore").Page("*")
Set obj = page.FindChild(Array("innerText", "tagName"), Array("CON*", "Tab"),100)
obj.Click
End Sub
--
Dmitry Nikolaev
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Dmitry Nikolaev
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
09-15-2010
08:55 PM
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2010
03:21 AM
09-17-2010
03:21 AM
Hi Mazhar,
Thank you for the sample application. As I see, HTML Components (*.HTC) are used in it. This is the cause of the problem - HTML Components are not currently supported by TestComplete.
I tried to find a workaround by working with these *.HTC controls via Internet Explorer's DOM document using native methods and properties, but these tabs are not accessible even in this case. So, it looks like there is no way to work with these tab objects even from within the tested page itself. Please contact the application developers and ask them whether there is a way to work with the tabs in a script within the tested page. If there is a way to do this, most probably, it will be possible to adapt this way for TestComplete.
--
Dmitry Nikolaev
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Dmitry Nikolaev
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

- « Previous
- Next »
- « Previous
- Next »