-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keyword "Get page source": Add selector for partial source code #3460
Comments
So are you looking what this Playwright API returns https://playwright.dev/docs/api/class-locator in innerHTML ? |
Yes, exactly. |
And lastly, when you want to assert a certain content in the page source, you normally know where it should roughly be. No need to search the complete DOM or even worse, dump it in case of a failure. |
@allcontributors please add @simonmeggle for ideas |
@simonmeggle already contributed before to ideas |
With Get Property <selector> innerHTML This just includes the content of an element. Get Property <selector> outerHTML This includes the element itself. I think So maybe we could add a new keyword for innerHTML and outerHTML so that it is more obvious for users. |
Ah, nice. Did not know this, thanks! |
I want to propose to add an optional
selector
to the keywordGet Page Source
.The current implementation only supports to get the complete page source which can be a huge amount of data.
Long use case description:
The idea for a selector came when I was trying to find a selector for
Get Text
keyword.My current way is to F12 into the browser devtools, pick the element and then inspect where I could start to locate. As long as the selector is pure XPath/CSS, I develop the selector in the console wia
$x()
or$$()
.The conveniance feature of Browserlib to concatenate Xpath and CSS with
>>
, as well as frame selectors (>>>
) comes at the cost to built them via the Debug Console of VS code, because the browser console does not understand this syntax.That requires to switch between VS Code and the Browser Devtools multiple times (or to work with tiled windows...)
It would relly help to do something like this:
Here, I used
Get Page Source
to get a HTML snippet as output right into the debug console of VS Code.From there I can inspect the interesting HTML source code easily and go on to refine the selector - without switching back to the browser.
The text was updated successfully, but these errors were encountered: