2

Hi Below is my code,

<TR>
<TD ALIGN="LEFT" id=oldcontent>40_FDI12p_</TD>
<TD>..........</TD>
<TD>..........</TD>
<TD>
    <form action="get.do"  method="post"  style="margin:3px">
        <input type="submit" id="button" value="Edit"  />
    </form> 
</TD>   
</TR>

I need to click on the Edit button based on the text present in the first 40_FDI12p_.Can anyone help me with the xpath?Thanks in advance

2 Answers 2

2
"//td[contains(text(),'40_FDI12p_')]"

will serve the purpose.

Sign up to request clarification or add additional context in comments.

1 Comment

what is selenium here?
0

I do this (c#):

public static void ClickButton(this ISearchContext searchContext, string text)
{
    searchContext.TagNames("button").First(x => x.Text == text).Click();
}

With

public static ReadOnlyCollection<IWebElement> TagNames(this ISearchContext searchContext, string tagName)
{
    return searchContext.FindElements(By.TagName(tagName));
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.