I am attempting web automation with a platform called Robocorp using the Selenium library.
When I run my program, I have no issues until I encounter this page where I am trying to get the program to click on the icon that says SQL.
I want the <a>
element with the @href
attribute.
Here are some (of many) XPaths I have tried that have all failed:
xpath://a[contains(@href,'sql_form.jsp')]
xpath://*[text()='SQL']
xpath://a[@target='frame2]
Snapshot of the element:
I circled the element in red ^^^
I cannot get the selector to be recognized on this page. I have tried adding delays, waiting until the element is active, waiting until the element is visible, etc.
Nothing seems to work.
Here is an image of the elements I am trying to select. (The link in the href element takes me to the page I am trying to access).
I thought that the third one would for sure work but is still failing.
I am using a platform called Robocorp which only needs the raw selector to work (CSS or XPath)
To identify the element with text as SQL you can use you can use either of the following locator strategies:
Using Wait Until Element Is Visible
:
Wait Until Element Is Visible xpath=//a[starts-with(@href, 'sql_form.jsp') and @target='frame2']/font[text()='SQL'] 10 seconds
Using Wait Until Element Is Enabled
:
Wait Until Element Is Enabled xpath=//a[starts-with(@href, 'sql_form.jsp') and @target='frame2']/font[text()='SQL'] 10 seconds
You can find a couple of relevant detailed discussions in: