Ask a Question

Element slides away on highlighting

amit_bansal
Occasional Contributor

Element slides away on highlighting

While using object spy, I am selecting the element by glyph. The target address is filled in the in the object textbox. But when I click on highlight, the element on the modal window slides down and is not "visible on screen".

24 REPLIES 24

Try, before you do the clickitem, call a "ScrollIntoView".. like so

Aliases.browser.pageQaInstanceArcadiaMode.panelMwindiv.frameMwinFrame.BatchUpdatetable.cellData1.selectUaDwritestatus.scrollIntoView(true);

Aliases.browser.pageQaInstanceArcadiaMode.panelMwindiv.frameMwinFrame.BatchUpdatetable.cellData1.selectUaDwritestatus.ClickItem('Append');

 


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
amit_bansal
Occasional Contributor

Already tried that. It scrolls the element in to view but when clickitem is executed, it slides down. As I shared earlier, when element is visible on screen and I tried highlighting, it slides down and the property visible on screen turns False. 

 

So... it's the actual modal window the scrolls and not the drop down control?

 

Then call "scrollIntoView" on the modal, not the drop down control... make sure that the modal is fully on screen properly.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
amit_bansal
Occasional Contributor

I had even tried executing the only step click item after scrolling in to view the element manually BUT when click item is executed it scrolls down again.  

So, I'm unclear... is the item selected or not?  

The reason I ask... is it possible that the problem is not in selecting the item but in the following steps?  Please post a screenshot of your code as it stands right now and corresponding log results... include in the log the "additional info" tab for the error.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
amit_bansal
Occasional Contributor

The drop down item is no selected. I had attached the screenshot of the steps. It scrolls in to view the drop down and then it slides down. 

amit_bansal
Occasional Contributor

The drop down item is no selected. I had attached the screenshot of the steps. It scrolls in to view the drop down and then it slides down.

OK... so... I see right away part of the problem.... each time you call "FindChild", you're returning another handle to the same object.  So, it's possible that the FindChild is calling some sort of refresh which re-scrolls the screen.

 

Since the drop down control IS mapped (MappedName in the properties), there's no need to do a FindChild.  Simply call the Aliased object.  

 

Alternatively, use FindChild to find the object and assign the result of FindChild to a variable.  Then, use that variable to call "ClickItem".  That way you're working with the same memory handle of the object rather than two different ones.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
amit_bansal
Occasional Contributor

Thanks for your effort. I think the issue is that two elements have save mapped name and that is causing this issue. 

Since you're using "FindChild" for your work, the fact that there are two components with the same mapped name shouldn't affect it... 

 

HOWEVER, if you have two components with the same object identifier so that FindChild isn't always finding the one you want (which could also be why two components map as the same object), then that would be certainly the issue.  You should use more than just "ObjectIdentifier" as the property for identification... you might need to see if there are other properties to add to make the identification more unique.... that applies to the mapping as well.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
cancel
Showing results for 
Search instead for 
Did you mean: