Using robotframework without locators (Id, class name, Xpath)

Hi!

How would you use robotframework if you don’t have acces to the inspector / console to “see” the locators (Id, class name, Xpath, etc. ) and use them ?

In another words, if I want to use SeleniumLibrary, how do I use “Click Element” if I can’t use / acces the locators ?

Do you know a plugin that could be used ?

Thanks,
TextSolver34761

Hi @TextSolver34761,

I gather you don’t have access to dev tools because your companies admin team have disabled it through group policy?

  • Stage one is to request they give you access, use required to do your job as justification, you’ll probably need your test manager on board to help you here, because all the suggestions I can offer below will be slower and therefore cost your employer money, your test manager should use that as part of the argument for you getting access (or ask the security team to fund part of your wage, money usually motivates a change in mind from security teams)

Now for some work around ideas:

  • can you install browser extensions? (I’m guessing probably not), If you can there are some extensions that may help search your browser’s extensions for thing like:

    • robot framework
    • xpath
    • css
  • Selenium Library has Get Source,

    • make this the last keyword in your test case then
    • open browser to page and get source
    • paste the source into http://xpather.com/ and develop your xpath to your first navigation and add that step in to your script before Get Source
    • run your test, grab the next source, xpather, add next step, repeat
    • did I mention this is slower than using dev tools? yeah not the fastest way to devop a script…

There’s probably some other work arounds but those are what I can think of quickly,

Dave.

5 Likes

You could also look into non-browser extension/addon tools that might help for your case if you’re restricted in inspecting elements from the native browser tools or addons. Maybe these could be useful:

1 Like

Also, some other thoughts on your system restrictions. I’m assuming this is on Windows, there could be less workarounds for macOS.

You could look into portable app versions of browsers like PortableFirefox, maybe there is version for Chrome and Edge but I don’t know. It may be that since these are standalone binaries, they may not be restricted in the way the standard installed browsers are, and these don’t need installation if installing your own apps is blocked by your company policy. You just download, extract and run, mostly though some come with an extraction installer but it isn’t really doing real installation. You may not be able to run automated tests or run them as well with these portable browser binaries but you can at least use them for the manual element inspection route when developing the test cases / automation.