Search
 
 

Display results as :
 


Rechercher Advanced Search

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

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

View previous topic View next topic Go down

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

Post by selenium.testing07 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

selenium.testing07
Regular Participant
Regular Participant

Posts : 26
Join date : 2010-11-20

Back to top Go down

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

Post by Adviser 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

Adviser
------------------------
------------------------

Posts : 379
Join date : 2009-07-30
Location : India

http://seleniumforum.forumotion.net

Back to top Go down

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

Post by selenium.testing07 on Sun Nov 28, 2010 5:01 pm

Thanks a lot for your idea........
Can I have few example?

selenium.testing07
Regular Participant
Regular Participant

Posts : 26
Join date : 2010-11-20

Back to top Go down

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

Post by selenium.testing07 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!



selenium.testing07
Regular Participant
Regular Participant

Posts : 26
Join date : 2010-11-20

Back to top Go down

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

Post by selenium.testing07 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

selenium.testing07
Regular Participant
Regular Participant

Posts : 26
Join date : 2010-11-20

Back to top Go down

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

Post by Sponsored content Today at 7:31 pm


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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