Skip to main content
Solved

How to search text on webpage and do something after


Forum|alt.badge.img+2

On my webpage i have a list order. i want to find an orderID and click it . this is a div type. please help me !

 

Best answer by AWilson

Hi,

 

I would do this by using a variable in the XPath. You can write an XPath that looks for your element on the webpage based on the value of your attribute in AA.

 

I would imagine that the DOMXPath would look something like this:

//a[text() = "Your Variable Here"]

 

If you aren’t comfortable writing your own DOMXPaths, this tutorial gives a great overview of how it works: 

 

I hope this helps

Adam

View original
Did this topic help answer your question?

2 replies

AWilson
Forum|alt.badge.img+5
  • Navigator | Tier 3
  • 12 replies
  • Answer
  • March 9, 2023

Hi,

 

I would do this by using a variable in the XPath. You can write an XPath that looks for your element on the webpage based on the value of your attribute in AA.

 

I would imagine that the DOMXPath would look something like this:

//a[text() = "Your Variable Here"]

 

If you aren’t comfortable writing your own DOMXPaths, this tutorial gives a great overview of how it works: 

 

I hope this helps

Adam


Forum|alt.badge.img+2
  • Author
  • Cadet | Tier 2
  • 5 replies
  • March 10, 2023
AWilson wrote:

Hi,

 

I would do this by using a variable in the XPath. You can write an XPath that looks for your element on the webpage based on the value of your attribute in AA.

 

I would imagine that the DOMXPath would look something like this:

//a[text() = "Your Variable Here"]

 

If you aren’t comfortable writing your own DOMXPaths, this tutorial gives a great overview of how it works: 

 

I hope this helps

Adam

Thank you, i have  solved this problem with your guide 

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings