Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

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

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

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
Advisor
Advisor
------------------------
------------------------
Posts : 387
Join date : 2009-07-30
Location : India
https://seleniumforum.forumotion.net

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

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
selenium.testing07
selenium.testing07
Regular Participant
Regular Participant
Posts : 26
Join date : 2010-11-20

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

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

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

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
selenium.testing07
Regular Participant
Regular Participant
Posts : 26
Join date : 2010-11-20

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

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

Selenium RC with C#: How to Delete or edit particular item? Empty 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