Page 1 of 1

Not able to get the webTable Row Count.

Posted: Fri Jun 01, 2012 5:52 am
by Murali4426
Hi ,
i am new this tool.please suggest me how to get the web table Row count .
please let me know how to use the RXpathe.please provide the sample code.

Table id is # "body/form/div[@id='s4-workspace']/div/div[@id='s4-mainarea']/div[@id='MSO_ContentTable']/div[2]/div/div/div/div[@id='ctl00_PlaceHolderMain_WikiField']/div/div/table/tbody/tr/td/div/div/div[1]/div[@id='div_e37f982d-ba2f-4a63-b019-eda7d420049d']/table/tbody/tr/td/table/tbody/tr/td/div/div/table/tbody/tr[1]/td/div[@id='ctl00_m_g_e37f982d_ba2f_4a63_b019_eda7d420049d_idVocabularyUC_divgridListDatawithChk']/table/tbody/tr/td/div/table[@id='ctl00_m_g_e37f982d_ba2f_4a63_b019_eda7d420049d_idVocabularyUC_spgridlistData']".

Thanks,
Murali.

Re: Not able to get the webTable Row Count.

Posted: Fri Jun 01, 2012 7:36 am
by Support Team
Hi,

You can get the count of the rows of your table via the tables adapter, for instance:
Table table = "body/form/div[@id='s4-workspace']/div/div[@id='s4-mainarea']/div[@id='MSO_ContentTable']/div[2]/div/div/div/div[@id='ctl00_PlaceHolderMain_WikiField']/div/div/table/tbody/tr/td/div/div/div[1]/div[@id='div_e37f982d-ba2f-4a63-b019-eda7d420049d']/table/tbody/tr/td/table/tbody/tr/td/div/div/table/tbody/tr[1]/td/div[@id='ctl00_m_g_e37f982d_ba2f_4a63_b019_eda7d420049d_idVocabularyUC_divgridListDatawithChk']/table/tbody/tr/td/div/table[@id='ctl00_m_g_e37f982d_ba2f_4a63_b019_eda7d420049d_idVocabularyUC_spgridlistData']";
int count = table.Rows.Count;
Regards,
Markus
Ranorex Support Team

Re: Not able to get the webTable Row Count.

Posted: Mon Jun 04, 2012 9:24 am
by Murali4426
Hi ,
I tried the below code still i am not able to get the row count.
i am getting the error message like#"No element found for path 'body/form/div[@id='s4-workspace']/div/div[@id='s4-mainarea']/div[@id='MSO_ContentTable']/div[2]/div/div/div/div[@id='ctl00_PlaceHolderMain_WikiField']/div/div/table/tbody/tr/td/div/div/div[1]/div[@id='div_e37f982d-ba2f-4a63-b019-eda7d420049d']/table/tbody/tr/td/table/tbody/tr/td/div/div/table/tbody/tr[1]/td/div[@id='ctl00_m_g_e37f982d_ba2f_4a63_b019_eda7d420049d_idVocabularyUC_divgridListDatawithChk']/table/tbody/tr/td/div/table[@id='ctl00_m_g_e37f982d_ba2f_4a63_b019_eda7d420049d_idVocabularyUC_spgridlistData']' within 10s. "

Thanks,
Murali.

Re: Not able to get the webTable Row Count.

Posted: Mon Jun 04, 2012 11:07 am
by Support Team
Hi,

Please send us a Ranorex Snapshot file of the table, the following link shows how you can create it:
Creating Ranorex Snapshot Files.
The message stated that your RxPath is invalid, do you have checked with the Spy tool if the used Id's change after a restart of your AUT?
Maybe you should use another attribute instead of the id, are there another unique attributes?

Regards,
Markus
Ranorex Support Team

Re: Not able to get the webTable Row Count.

Posted: Mon Jun 04, 2012 3:37 pm
by Murali4426
Hi,
object is added to the object repository and click on highlight tool is identifying the object.
I copied the same properties and added in to code .i am running the code object is not identifying the tool.

please find the attachment.

Thanks,
Murali

Re: Not able to get the webTable Row Count.

Posted: Tue Jun 05, 2012 5:05 pm
by Support Team
Hi,

Thanks for the snapshot file!
I inputed your RxPath into the snapshot file, but I wasn't able to identify the table because one index of a div tag was wrong, so are you sure the RxPath doesn't change after a restart of your page?
The new Ranorex version is already released, you can download it from the start page of Ranorex Studio, I would suggest trying it with the new version.
Could it be that you have just installed the client version of the .Net 4.0 framework, if so please install the full/extended one before you update to 3.3 because Ranorex needs the full version otherwise there can be errors.

Regards,
Markus
Ranorex Support Team