Unable to click on button when executed the test end to end
Posted: Fri Jun 15, 2018 12:54 pm
Hi Folks,
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
// //Ranorex.Container FormCont = @"/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[@controlname='Panel1']/container[@controlname='GroupBox1']/container[@controlname='Panel2']";
// IList<Ranorex.Button> btns = FormCont.FindDescendants<Ranorex.Button>();
//
// foreach( var btn in btns)
// {
// if (btn.Text.ToString() == "Create")
// {
// btn.Click();
// flag=true;
// break;
// }
// }
// if (flag == true)
// {
// Report.Info("Clicked on Create Button");
// }
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();
Detailed description of system
Operating system : Win10 Enterprise
Ranorex version : Ranorex 7.0.1
But i am unable to click on Create button when executed in test suite.
Please help me in resolve this
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
// //Ranorex.Container FormCont = @"/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[@controlname='Panel1']/container[@controlname='GroupBox1']/container[@controlname='Panel2']";
// IList<Ranorex.Button> btns = FormCont.FindDescendants<Ranorex.Button>();
//
// foreach( var btn in btns)
// {
// if (btn.Text.ToString() == "Create")
// {
// btn.Click();
// flag=true;
// break;
// }
// }
// if (flag == true)
// {
// Report.Info("Clicked on Create Button");
// }
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();
Detailed description of system
Operating system : Win10 Enterprise
Ranorex version : Ranorex 7.0.1
But i am unable to click on Create button when executed in test suite.
Please help me in resolve this