Not able to get the webTable Row Count.

Class library usage, coding and language questions.
Murali4426
Posts: 6
Joined: Tue Apr 24, 2012 3:36 pm

Not able to get the webTable Row Count.

Post by Murali4426 » Fri Jun 01, 2012 5:52 am

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.
You do not have the required permissions to view the files attached to this post.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Not able to get the webTable Row Count.

Post by Support Team » Fri Jun 01, 2012 7:36 am

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

Murali4426
Posts: 6
Joined: Tue Apr 24, 2012 3:36 pm

Re: Not able to get the webTable Row Count.

Post by Murali4426 » Mon Jun 04, 2012 9:24 am

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.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Not able to get the webTable Row Count.

Post by Support Team » Mon Jun 04, 2012 11:07 am

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

Murali4426
Posts: 6
Joined: Tue Apr 24, 2012 3:36 pm

Re: Not able to get the webTable Row Count.

Post by Murali4426 » Mon Jun 04, 2012 3:37 pm

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
You do not have the required permissions to view the files attached to this post.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Not able to get the webTable Row Count.

Post by Support Team » Tue Jun 05, 2012 5:05 pm

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