HezzelQuartz Posted February 23, 2025 Posted February 23, 2025 How to define Webdriver $sSelector or $_WD_LOCATOR in this element below: <a class="btn btn-grad-orange" href="/wallet/login.asp">Login</a> Can i useย $_WD_LOCATOR_ByXPath for this? Thank You
Danp2 Posted February 24, 2025 Posted February 24, 2025 Yes, you can use any type of selector you would like to use. Have you tried usingย _WD_LinkClickByText? Latest Webdriver UDF Release Webdriver Wiki FAQs
HezzelQuartz Posted February 24, 2025 Author Posted February 24, 2025 (edited) 5 hours ago, Danp2 said: Yes, you can use any type of selector you would like to use. Have you tried usingย _WD_LinkClickByText? No, I haven't triedย _WD_LinkClickByText ย but How to useย $_WD_LOCATOR_ByXPath in my case? Edited February 24, 2025 by HezzelQuartz
Solution SOLVE-SMART Posted February 24, 2025 Solution Posted February 24, 2025 (edited) Hi @HezzelQuartzย ๐ , my assumption is something like this: <body> <div> <form> <a class="btn btn-grad-orange" href="/wallet/login.asp">Login</a> </form> </div> </body> Now only some of the locator strategy options: ; XPath selector //a[@href='/wallet/login.asp'] //a[contains(@href, 'login.asp') and text()='Login'] ; CSS selector a[href='/wallet/login.asp'] ; or by link text ; or by class name ; or by tag name In AutoIt (au3WebDriver), I personally use XPath as default locator strategy. In other frameworks like WebdriverIO, (Selenium) or Playwright, I often use CSS selectors. You can generate several of them directly in Chrome (for example). See the following screenshot: Open the Browser DevTools with F12. (1) right click on your target element (2) copy > (3) choose your locator strategy now use it in AutoIt ๐ Best regards Sven Edited February 24, 2025 by SOLVE-SMART ==> AutoIt related: ๐ย Organization AutoIt Community,ย ๐ GitHub, ๐ Discord Server, ๐ย Cheat Sheet,ย ๐ย autoit-webdriver-boilerplate Spoiler ๐ย Au3Forums ๐ฒ AutoIt (en) Cheat Sheet ๐ AutoIt limits/defaults ๐ Code Katas: [...] (comming soon) ๐ญ Collection of GitHub users with AutoIt projects ๐ย False-Positives ๐ฎย Me on GitHub ๐ฌย Opinion about new forum sub category ๐ย UDF wiki list โย VSCode-AutoItSnippets ๐ย WebDriver FAQs ๐จโ๐ซย WebDriver Tutorial (coming soon)
HezzelQuartz Posted February 24, 2025 Author Posted February 24, 2025 2 hours ago, SOLVE-SMART said: Hi @HezzelQuartzย ๐ , my assumption is something like this: <body> <div> <form> <a class="btn btn-grad-orange" href="/wallet/login.asp">Login</a> </form> </div> </body> Now only some of the locator strategy options: ; XPath selector //a[@href='/wallet/login.asp'] //a[contains(@href, 'login.asp') and text()='Login'] ; CSS selector a[href='/wallet/login.asp'] ; or by link text ; or by class name ; or by tag name In AutoIt (au3WebDriver), I personally use XPath as default locator strategy. In other frameworks like WebdriverIO, (Selenium) or Playwright, I often use CSS selectors. You can generate several of them directly in Chrome (for example). See the following screenshot: Open the Browser DevTools with F12. (1) right click on your target element (2) copy > (3) choose your locator strategy now use it in AutoIt ๐ Best regards Sven Thank You Really Helpful for me SOLVE-SMART 1
HezzelQuartz Posted March 3, 2025 Author Posted March 3, 2025 (edited) @SOLVE-SMART ย expandcollapse popup<body id="body-overlay"> <div class="xyz-content"> <div class="container"> <div class="xyz-wrapcontent"> <div id="history" class="xyz-history-container"> <div class="xyz-history-content"> <div id="tbl" class="xyz-history-table-content"> <table class="table table-hover table-sm table-striped" style="width:100%"> <tbody> <tr> <td> <ul> <li> ::marker <strong>Transaction ID:</strong> 4537988 </li> </ul> </td> </tr> <tr> <td> <ul> <li> ::marker <strong>Transaction ID:</strong> 4537107 </li> </ul> </td> </tr> <tr> <td> <ul> <li> ::marker <strong>Transaction ID:</strong> 4537092 </li> </ul> </td> </tr> </tbody> </div> </div> </div> </div> </div> </div> </div> </body> how about my example above? How to use Webdriver to get first, second, and third Transaction ID?ย I Want to get the text Or Maybe I Think I should create new thread Edited March 3, 2025 by HezzelQuartz
SOLVE-SMART Posted March 4, 2025 Posted March 4, 2025 (edited) Hi @HezzelQuartzย , new threads are often the better way, yes. So my answer (possible solution) can be found in through ๐ย this post. Best regards Sven Edited March 5, 2025 by SOLVE-SMART ==> AutoIt related: ๐ย Organization AutoIt Community,ย ๐ GitHub, ๐ Discord Server, ๐ย Cheat Sheet,ย ๐ย autoit-webdriver-boilerplate Spoiler ๐ย Au3Forums ๐ฒ AutoIt (en) Cheat Sheet ๐ AutoIt limits/defaults ๐ Code Katas: [...] (comming soon) ๐ญ Collection of GitHub users with AutoIt projects ๐ย False-Positives ๐ฎย Me on GitHub ๐ฌย Opinion about new forum sub category ๐ย UDF wiki list โย VSCode-AutoItSnippets ๐ย WebDriver FAQs ๐จโ๐ซย WebDriver Tutorial (coming soon)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now