Share
Go down
avatar
selenium.testing07
Regular Participant
Regular Participant
Posts : 26
Join date : 2010-11-20

Selenium RC with C#: How to Delete or edit particular item?

on Sat Nov 27, 2010 11:52 pm
Hi All,

Actually, I record a script and made some change.
I want to Delete many record by name, one by one , recorded script works fine for first recorded name A, and gets fail for rest.

Basically, Delete buttons have particular account id, whenever I want to press delete button it detect same account ID.

In that case I need to see that particular account ID by Xpater, and change the same in Script. this is waste of time.

My point is, I want to search account by name and want to delete same, I can search but when need to click Delete it detect Account ID, it will fail if account id does not match.

Is there any option to Ignore Account ID on Delete button and make possible to Click Delete button?
How can I use Indexing?


Thanks,
Selenium
avatar
Advisor
------------------------
------------------------
Posts : 383
Join date : 2009-07-30
Location : India
http://seleniumforum.forumotion.net

Re: Selenium RC with C#: How to Delete or edit particular item?

on Sun Nov 28, 2010 11:42 am
Hi,

I got your point. For this type of functionality you have to create your own function which perform a sql type search on basis of condition and perform operation on that. I am telling you how to do it:

1. first store your table in multi dim array.
2. now pass the condition and match each record row by row.
3. if record found, return the row number.
4. now put that row number into a generic xpath which contain index instead of id
ex:
actual : //body[@id='phpbb']/div/div/div/div[@id='wrap']
generic: //body[@id='phpbb']/div/div/div/div[1]
5. finally click on delete button and your selected record is deleted no matter at which position it exist.

Hope this will help you. Best of luck.

Bye
avatar
selenium.testing07
Regular Participant
Regular Participant
Posts : 26
Join date : 2010-11-20

Re: Selenium RC with C#: How to Delete or edit particular item?

on Sun Nov 28, 2010 5:01 pm
Thanks a lot for your idea........
Can I have few example?
avatar
selenium.testing07
Regular Participant
Regular Participant
Posts : 26
Join date : 2010-11-20

Re: Selenium RC with C#: How to Delete or edit particular item?

on Mon Nov 29, 2010 7:49 pm
Hi,
In Xpather I found this html value:
/html/body/div[1]/div[@id='Header2']/div[2]/div[2]/table/tbody[@id='callCenterData']/tr/td[4]/a[@id='status254']


Now in C# it shows like below:
selenium.Click("status254");

every time when I play for other account script fail because @id "status254"
have been changed or new account.


Now what should I enter from this HTML tag

/html/body/div[1]/div[@id='Header2']/div[2]/div[2]/table/tbody[@id='callCenterData']/tr/td[4]/a[@id='status254']

I don't know which one is generic?

Please clarify me.....I just stuck over here.
please explain with these value if possible.

Thanks!


avatar
selenium.testing07
Regular Participant
Regular Participant
Posts : 26
Join date : 2010-11-20

Re: Selenium RC with C#: How to Delete or edit particular item?

on Thu Dec 02, 2010 7:08 pm
Hi,
I got the solution. Smile
Actually this is the same as admin had explain.
See, there are two solution; which is explained by admin.

Thanks a lot ...................Smile Smile
Sponsored content

Re: Selenium RC with C#: How to Delete or edit particular item?

Back to top
Permissions in this forum:
You cannot reply to topics in this forum