Forum Discussion
yes I tried that but i am not getting any object in return when I execute this
Sys.Process("iexplore").Page("*").Form("aspnetForm").Panel("divHeaderAndContent").Panel("contentWrapper").Panel(0).Panel(0).Panel(2).Panel(0).Panel(0).Panel(0).Panel(0).Panel(0).Table(0).Cell(2, 4).QuerySelector("span.glyphicon glyphicon-pencil pointer")
it this correct because i am getting an object when i evaluate this but I am not able to inspect that object.
please see attach image in that image we can see object as Result but the Inspect button is disabled not sure why and not able to check what I am getting.
Hi Amey,
> it this correct because i am getting an object when i evaluate this but I am not able to inspect that object.
I think that what you do is correct and you are getting expected result.
As per http://support.smartbear.com/testcomplete/docs/reference/test-objects/members/page/queryselector-action-page-object.html : "If there is no matching TestComplete test object, the method returns the appropriate HTML object." So, as TestComplete does not 'see' this glyph object (it is absent in the Object Browser), the native HTML object is returned. Obviously, it cannot be inspected in TC's debugger, but I am pretty sure that it is possible to call its native methods as described here: http://support.smartbear.com/testcomplete/docs/app-testing/web/general/common-tasks/accessing-native-attributes.html.
So you need to check (ask developers) if the found element has a native method like .click() that can be called to emulate the click on it (I believe that vm.action() should be called but confirm this with developers). Otherwise, you will need to find its (absolute) coordinates and perform coordinate-based click using TestComplete means.
P.S. http://support.smartbear.com/testcomplete/docs/app-testing/web/general/common-tasks/javascript.html provides an info on how to execute script from web page - it might help to properly call vm.action() method.
P.P.S. However, I think that all from above overcomplicates your task and coordinate-based click within the proper table cell will be stable and reliable enough.
- ameykhopade8 years agoContributor
Hi Apologies for late reply.
you are right it is giving me the HTML object and cant be inspected.
I wasn't able to call the native method (vm.action() ) but i am able to now call the click method with the correct syntax.
the correct syntax to click the object is :
Sys.Process("iexplore").Page("*").Form("aspnetForm").Panel("divHeaderAndContent").Panel("contentWrapper").Panel(0).Panel(0).Panel(2).Panel(0).Panel(0).Panel(0).Panel(0).Panel(0).Table(0).Cell(2, 4).QuerySelector("span.glyphicon.glyphicon-pencil.pointer").Click()
this is working for me.
here I calling the QuerySelector Method on its immediate parent which is detected by object spy and supports the QuerySelector method.
The co-ordinate logic would have not worked in my case as the position of the edit img varies in the table cell.
thanks,
Amey
Related Content
- 5 years ago
- 8 years ago
Recent Discussions
- 8 hours ago