I am unable to click on a button in a ranorex module on .NET WinForms application using the below methods due to object not identified when executed the test end to end in Ranorex TestSuite.But when i select that particular step in a module and "Run Selected Item" it's working whereas when executed in a sequence in test suite/module its not clicked.

I followed multiple ways to identify the button object.
1)using Ranorex Recording
2)dynamically getting the buttons from the page

Steps involved in my testcase :
a)Logginng into our portal
b)Launch a new tab on a page.{I used wait time for the page being loaded,but when i debugged and see the value of the object it is showing "Timeout"}
c)I want to click on a button in this page.
3) used the below steps before clicking on the button
Validate.Exists(repo.Portal.CreatebtnInfo);
Validate.Attribute(repo.Portal.CreatebtnInfo, "Enabled", "True");
repo.Portal.Createbtn.EnsureVisible();
repo.Portal.Createbtn.Click();

Even better, you should NOT reference an element in code like this. Instead, you should link it directly from repository, by adding repoiteminfo element, as a parameter of your click method. E.g. like this...

At second, is there a reason why you are using script for clicking one particular button? I would just add Mouse Click action to the recording. Or are there more 'Create' buttons on the page?<There is no specific reason to use script instead of just a mouse click action instead i was not able to click on the button so tried using the script but still no luck as the object is not identified.>

Anyway, if you insist on using script, for this particular action, you should add '.' before '/form' string. So the xpath should look like this:<I added '.' before '/form' now.Thanks.>

There are couple of buttons like 'Create' on this page Excess Quantity,SOR Roll,Delete,Add Lines etc..
All these buttons are not identified easily when executed from testsuite but when i highlight them individually its highlighted.

They are able to be clicked when ran individual statements/modules but when executed from test suite end to end it is failed to identify object.

Last edited by devarak on Tue Jun 26, 2018 12:28 pm, edited 3 times in total.

What you've uploaded is not snapshot, but screenshot. It's a big difference Please learn how to create a snapshot here:https://www.ranorex.com/help/latest/les ... shot-files
In case the snapshot is too big for Ranorex forum, you can use a file sharing service like OneDrive or DropBox and here simply post a link. Thanks.

Hi odklizec,
I am new to Ranorex.Started learning the tool .Thanks for helping me to create the Ranorex snapshot

Here i am enclosing the Ranorex snapshot for the Create button

In the application all the buttons(Create,Add Manual Part,Add Lines,Line Detail,Excess Quantity etc..) shown are not identified when ran from testsuite.Normally they are clicked when ran individual statements.

Is this because of page loading time?for that i am using waitforexists method but didnt work.

or is it because of the data on the page is huge.If so how to handle it?

Thanks for the snapshot. From the snapshot it seems you are using Ranorex 7.0.1? It's a pretty old and no longer supported version of Ranorex. I would suggest to try the most recent Ranorex 8.1.2. There were many bug fixes and enhancements done between 7.0.1 and 8.2.1. So it's pointless to debug this problem with 7.0.1. Anything I or anyone else here will eventually suggest, is related to most recent Ranorex version

/form[@controlname='Portal']/container[@controlname='Portal_Fill_Panel']/?/?/container[@controlname='viewerPanel']/?/?/container[@controlname='dockPanel']/container[@controlname='DockControl']/container[@caption='' and @controltypename='ViewerControl' and @instance='1']/?/?/container[@controlname='dockPanel']/?/?/container[@controlname='TabControl']/?/?/container[@controltypename='UltraTabPageControl' and @instance='0']/container[@controlname='DockTabControl']//container[@controlname='splitContainerBrowser']//container[@controlname='bodyPlugin']//container[@controltypename='PanelEx']/button[@text='Create']

Both xpaths should work just fine, both from Recording and Test Suite. Using WaitFor Exists action before actual click action is a very good idea. And I would definitely suggest to start with recordings and repository elements, instead of messing with code and xpaths referenced in code, especially if you are a new Ranorex user.

Hi,
Thanks for your reply.
I have upgraded to Ranorex version 8.1.2.And now i have a problem while executing, there are no errors on the screen.I have referenced all the dlls i need into my project after converting to 8.1.2.But its breaking the execution immediately.I dont understand where i did the mistake.

And secondly if i want to downgrade again to 7.0 is there any way because its throwing me message you cannot downgrade from higher version to lower version.Please help me.

Unfortunately, without knowing the errors you are getting, there is not much anyone here can do or suggest. Please post the error message(s) you are getting.

As for downgrading 8.x solution to 7.x, it's not possible. However, during the solution conversion, Ranorex creates a zipped copy of existing solution (before conversion) and stores it in the main solution folder. Also, you should be able to obtain the working copy (7.x) of your solution from version control system...I hope you are using one? If not, you should IMMEDIATELY adopt it!!! It's a very bad practice developing TA (any SW) without using version control system.