Hi Team,
Please guide me how can I Click on "Edit" link just by giving the index number as shown in the attached Image
This Edit link is also a part of HTML table and so far I figured out the code as :
HtmlTable table = Find.ByExpression<HtmlTable>("TagIndex=table:0");
Assert.IsNotNull(table);
HtmlTableRow row = table.Find.ByExpression<HtmlTableRow>("innertext=~Edit","tagname=tr","tagindex=a:0");
HtmlTableCell cell = row.Cells[3];
HtmlAnchor a = cell.Find.ByExpression<HtmlAnchor>("innertext=~Edit","tagname=a");
a.Click();
But this code is NOT working. Please guide me how to accomplish this task ?
Note : the values in the table cells are always changing i.e., they are dynamic. So we cannot rely on existing data.
6 Answers, 1 is accepted
Sorry guys, I missed the attachment in the above post
Here it is
Hi Team,
Can anyone please look into this Issue and provide a solution as my testing is completely blocked because of this.
Please let me know if anymore information is required regarding this Issue
Thanks
Abdul
I'd approach the task this way:
- Locate the table as you do - I guess that works fine
- Locate the table row by index within this table
- Find the edit link within this row and click it.
Regards,
Konstantin Petkov
Telerik
Hi Konstantin,
Thanks for the approach and it worked for me.
I have one other query for you but NOT related to HTML.
Query :
Let say I have two tests - Test A and Test B
Test A - It contains only one coded step and inside it has "this.ExecuteTest(test_path);" . I am sending Test Path as an argument.
Test B - It contains some recorded steps
I am calling Test B from Test A.
After test execution, if Test B fails, I want to return a value to Test A like "Fail"
How can I achieve this ?
Let me know If you need more information.
Thanks
Abdul
Hi Konstantin,
Can you have a look into this Issue and let me know the best solution ?
After Test B execution is completed, I just want to send a value from Test B as "FAIL" to Test A
How can I achieve this ?
Since this is a completely new issue please create a new ticket about it.
The best practice is to split separate issues in different tickets which help us better investigate and handle them in timely manner.
Thank you for your understandings!
Regards,
Boyan Boev
Telerik