Skip to main content
Answer

How to search text on webpage and do something after

  • March 9, 2023
  • 2 replies
  • 920 views

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

2 replies

AWilson
Forum|alt.badge.img+5
  • Navigator | Tier 3
  • 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
  • March 10, 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

Thank you, i have  solved this problem with your guide