{
//click the combo box
models.Click(Location.CenterRight, 1000);
//Find the list item you want to click
ListItem item = "/container[@caption='selectbox']/listitem[@text='" + ComboItem + "']";
//Click the item
item.Click(Location.Center, 1000);
}
WebDocument web = "/dom[@page='combo.html']";
SelectTag selectTagS = web.FindSingle(".//select[@name='s']");
//Open Combobox to get the container
selectTagS.Click();
//Searching for the container containg the list items
IList<Ranorex.ListItem> optionList = Host.Local.Find<Ranorex.ListItem>("/container[@caption='selectbox']/listitem");
foreach(ListItem listItem in optionList)
{
//Open combobox
selectTagS.Click();
//Click list item
listItem.Click();
}chunkylover53 wrote:This just doesn't work: /container[@caption='selectbox']/listitem because it's not in my ranorexpath to the control. My ranorexpath looks like this: /dom[@domain='192.168.245.138']/body/form/div[3]/div[@id='middle']/div/div/div[@id='content']/div/div[1]/div/div[1]/select[@id='cphContent_ddlFilter']
chunkylover53 wrote:I don't understand why it works with the recorder but not in my code.
/////////////////////////////////////////////////////////////////////////////// // // This file was automatically generated by RANOREX. // DO NOT MODIFY THIS FILE! It is regenerated by the designer. // All your modifications will be lost! // http://www.ranorex.com // /////////////////////////////////////////////////////////////////////////////// using System; using System.Collections.Generic; using System.Text; using System.Drawing; using Ranorex; using Ranorex.Core; using Ranorex.Core.Repository; namespace PortalWebTests { /// <summary> /// The class representing the PortalWebTestsRepository element repository. /// </summary> [System.CodeDom.Compiler.GeneratedCode("Ranorex", "2.3.4")] public partial class PortalWebTestsRepository : RepoGenBaseFolder { static PortalWebTestsRepository instance; /// <summary> /// Gets the singleton class instance representing the PortalWebTestsRepository element repository. /// </summary> public static PortalWebTestsRepository Instance { get { return instance; } } /// <summary> /// Repository class static constructor. /// </summary> static PortalWebTestsRepository() { instance = new PortalWebTestsRepository(); } PortalWebTestsRepositoryFolders.WebDocumentSearchandise_ReportalAppFolder _webdocumentsearchandise_reportal; PortalWebTestsRepositoryFolders.ContainerSelectboxAppFolder _containerselectbox; /// <summary> /// Repository class constructor. /// </summary> public PortalWebTestsRepository() : base("PortalWebTestsRepository", "", null, 30000, false) { _webdocumentsearchandise_reportal = new PortalWebTestsRepositoryFolders.WebDocumentSearchandise_ReportalAppFolder(null); _containerselectbox = new PortalWebTestsRepositoryFolders.ContainerSelectboxAppFolder(null); } /// <summary> /// The WebDocumentSearchandise_Reportal folder. /// </summary> public virtual PortalWebTestsRepositoryFolders.WebDocumentSearchandise_ReportalAppFolder WebDocumentSearchandise_Reportal { get { return _webdocumentsearchandise_reportal; } } /// <summary> /// The ContainerSelectbox folder. /// </summary> public virtual PortalWebTestsRepositoryFolders.ContainerSelectboxAppFolder ContainerSelectbox { get { return _containerselectbox; } } } /// <summary> /// Inner folder classes. /// </summary> public partial class PortalWebTestsRepositoryFolders { /// <summary> /// The WebDocumentSearchandise_ReportalAppFolder folder. /// </summary> public partial class WebDocumentSearchandise_ReportalAppFolder : RepoGenBaseFolder { private RepoItemInfo _somedivtagInfo; private RepoItemInfo _selfInfo; /// <summary> /// Creates a new WebDocumentSearchandise_Reportal folder. /// </summary> public WebDocumentSearchandise_ReportalAppFolder(RepoGenBaseFolder parentFolder) : base("WebDocumentSearchandise_Reportal", "/dom[@domain='192.168.245.138']", null, 30000, true) { _somedivtagInfo = new RepoItemInfo(this, "SomeDivTag", "body/form/div[3]/div[@id='middle']/div/div/div[@id='right']/div[1]/div", 10000, null); _selfInfo = new RepoItemInfo(this, "Self", "", 30000, null); } /// <summary> /// The SomeDivTag item. /// </summary> public virtual Ranorex.DivTag SomeDivTag { get { return _somedivtagInfo.CreateAdapter<Ranorex.DivTag>(true); } } /// <summary> /// The SomeDivTag item info. /// </summary> public virtual RepoItemInfo SomeDivTagInfo { get { return _somedivtagInfo; } } /// <summary> /// The Self item. /// </summary> public virtual Ranorex.WebDocument Self { get { return _selfInfo.CreateAdapter<Ranorex.WebDocument>(true); } } /// <summary> /// The Self item info. /// </summary> public virtual RepoItemInfo SelfInfo { get { return _selfInfo; } } } /// <summary> /// The ContainerSelectboxAppFolder folder. /// </summary> public partial class ContainerSelectboxAppFolder : RepoGenBaseFolder { private RepoItemInfo _listitem11334Info; private RepoItemInfo _listitem19295Info; private RepoItemInfo _listitem036000195583Info; private RepoItemInfo _listitem036000198409Info; private RepoItemInfo _selfInfo; /// <summary> /// Creates a new ContainerSelectbox folder. /// </summary> public ContainerSelectboxAppFolder(RepoGenBaseFolder parentFolder) : base("ContainerSelectbox", "/container[@caption='selectbox']", null, 30000, true) { _listitem11334Info = new RepoItemInfo(this, "ListItem11334", "listitem[@accessiblename='11334']", 10000, null); _listitem19295Info = new RepoItemInfo(this, "ListItem19295", "listitem[@accessiblename='19295']", 10000, null); _listitem036000195583Info = new RepoItemInfo(this, "ListItem036000195583", "listitem[@accessiblename='036000195583']", 10000, null); _listitem036000198409Info = new RepoItemInfo(this, "ListItem036000198409", "listitem[@accessiblename='036000198409']", 10000, null); _selfInfo = new RepoItemInfo(this, "Self", "", 30000, null); } /// <summary> /// The ListItem11334 item. /// </summary> public virtual Ranorex.ListItem ListItem11334 { get { return _listitem11334Info.CreateAdapter<Ranorex.ListItem>(true); } } /// <summary> /// The ListItem11334 item info. /// </summary> public virtual RepoItemInfo ListItem11334Info { get { return _listitem11334Info; } } /// <summary> /// The ListItem19295 item. /// </summary> public virtual Ranorex.ListItem ListItem19295 { get { return _listitem19295Info.CreateAdapter<Ranorex.ListItem>(true); } } /// <summary> /// The ListItem19295 item info. /// </summary> public virtual RepoItemInfo ListItem19295Info { get { return _listitem19295Info; } } /// <summary> /// The ListItem036000195583 item. /// </summary> public virtual Ranorex.ListItem ListItem036000195583 { get { return _listitem036000195583Info.CreateAdapter<Ranorex.ListItem>(true); } } /// <summary> /// The ListItem036000195583 item info. /// </summary> public virtual RepoItemInfo ListItem036000195583Info { get { return _listitem036000195583Info; } } /// <summary> /// The ListItem036000198409 item. /// </summary> public virtual Ranorex.ListItem ListItem036000198409 { get { return _listitem036000198409Info.CreateAdapter<Ranorex.ListItem>(true); } } /// <summary> /// The ListItem036000198409 item info. /// </summary> public virtual RepoItemInfo ListItem036000198409Info { get { return _listitem036000198409Info; } } /// <summary> /// The Self item. /// </summary> public virtual Ranorex.Container Self { get { return _selfInfo.CreateAdapter<Ranorex.Container>(true); } } /// <summary> /// The Self item info. /// </summary> public virtual RepoItemInfo SelfInfo { get { return _selfInfo; } } } } }
We need the Recorder Code / User Code. Depends on how you execute it in your executable. Would it be possible to post it again and please attach it as file. As file it is much easier to read for us instead of posting it as plain text. Thank you.Support Team wrote:Did you try using the code generated by the recorder? What's the RanoreXPath of the repository item used by Ranorex Recorder?
To analyze your problem, it is much easier for us with a Ranorex Snapshot of your control. How to create a Ranorex Snapshot...Support Team wrote:Could you post two Ranorex snapshots of the drop down: One when the drop down is closed and one when it's opened? (How to create a Ranorex Snapshot...)
chunkylover53 wrote:/dom[@domain='192.168.245.138']body/form/div[3]/div[@id='middle']/div/div/div[@id='right']/div[1]/div/container[@caption='selectbox']
chunkylover53 wrote:/dom[@domain='192.168.245.138']body/form/div[3]/div[@id='middle']/div/div/div[@id='right']/div[1]/div/container[@caption='selectbox']
Users browsing this forum: No registered users and 0 guests