No Longer able to click toolbars on new server

Ask general questions here.
houseofcutler
Posts: 52
Joined: Fri Mar 21, 2014 4:22 pm

No Longer able to click toolbars on new server

Post by houseofcutler » Wed May 28, 2014 1:26 pm

Hi There,

I have set up a new server with Ranorex but now when I run my test suite (migrated over form my machine) some actions work and some don't. Specifically - It can enter details into login boxes and click buttons, that's all fine but the problem comes when it tries to click one of the drop down menu items or home button across the top bar of the webpage (these are page items not browser tool bars), I can see the mouse move to the location and also appear to see a bit of a 'flash' like the image has had an action performed on it, but the action (e.g. open menu or load related page) does not occur.

*edit - I should be specific , Ranorex reports that the items in question have been clicked successfully - its just that nothing happens when they are.

Please note - this is a web based application (snapshot attached)
  • Server 2012
    IE 10
    Firefox 29
    Chrome 35
All three browsers have the Ranorex Extension 5.0.3.18203 and it is enabled

Does anyone have any ideas as to what might be missing - I am a bit stuck for ideas?

Thanks

Ben
Attachments
m5snapshot.rxsnp
(257.64 KiB) Downloaded 52 times

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: No Longer able to click toolbars on new server

Post by krstcs » Wed May 28, 2014 3:42 pm

Are you attempting to click the items directly after a page load/reload?

If so, this could be a timing issue. For many web pages, the scripts take a bit to fully load, even though the UI elements may be displayed. Ranorex does not wait for the web page to finish, by default. You have to tell it to wait for the page to complete before continuing, or it will just click on things as fast as it can when it finds them.

I recommend adding a WaitForDocumentLoaded() method in any of your modules that cause pages to load or reload. If you are using the action tables in Ranorex Studio, the WaitForDocumentLoaded is found under the InvokeAction action for a /dom type object only. If you are doing this in usercode, then you can just write the following code:

Code: Select all

repo.MyDom.Self.WaitForDocumentLoaded();

I use a special module that does this so I don't have to go into every module and change settings if I need to make changes to the wait timing. I call it "_WAIT_FOR_PAGE_LOAD" (makes it stand out and makes it be first in the lists). I also make all of my modules very small so they are more flexible. I can then just drop this WAIT module anywhere in my test case where I need to wait for a page to finish after a module.
Shortcuts usually aren't...

houseofcutler
Posts: 52
Joined: Fri Mar 21, 2014 4:22 pm

Re: No Longer able to click toolbars on new server

Post by houseofcutler » Wed May 28, 2014 4:56 pm

Thank you for the quick response Krstsc,

Although I remember it now you mentioned it I have never used the WaitForDocumentLoaded() method but I do have various delays in tactical places to cater for things like this - the menus that drop down from the top of the page being one.

After some more investigation I think the issue may just be that the performance on this server is very slow - its an old virtual box that I have 'acquired' but it only has 750MB and a 1x 2Ghz CPU. I have seen this is less than the recommended spec. I will ask for some more resources to be made available and see if this helps.

I will try and incorporate the WaitForDocumentLoaded() into some of my tests - I have to load a lot of pages and not all my modules are small enough to only incorporate one page in each - I take your point though about making them small and versatile this is something I have been looking at although if I only had actions for single pages per module I would literally have hundreds of modules by now!

Thanks again
ben

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: No Longer able to click toolbars on new server

Post by krstcs » Wed May 28, 2014 5:44 pm

Yeah, I have 250 modules in one of my tests, and growing... :D

But, creating the test cases is much easier. And, once you get going with building small modules, it is actually eaiser, in my opinion.

Remember, you can make modules that are generic and cover multiple use cases.

For example, you may have "Cancel" buttons on all of your pages. Assuming that there is no more than one of them (or if there are, that they all have the same effect), you can just make one "Click_Cancel" module. It would just click any button with the innertext of "Cancel" (RXPath = "//button[@innertext='Cancel']"), for instance. That way you won't have to make a module for each and every Cancel button (or OK, or whatever). This can be done with just about any input field, and it is especially helpful if your devs will use unique ids for the objects. So, all Cancel buttons would have an id attribute like "<button id='CancelButton'>Cancel</button>". This allows you to use the "#" unique id attribute in the RXPath and Ranorex will find the item much faster (this can only be done with the id attribute, and it has to be unique). Your RXPath would then be "//button[#'Cancel']" and it would be found quickly, no mater what the text was (innertext could be "Cancel" or "No" or another lanquage, even).


Edit to add: Also, with small modules you can always just throw them into groups and use the group in most places where you need those 2, 3, or how many ever modules, to do "something". Just remember that the group has no logic and has to be a straight-through business path. All the logic is in the modules or the test case (test cases are just for-each loops iterating over the data rows).
Shortcuts usually aren't...