0

I am working on a testing tool and am using Sikuli to emulate user requests to the web application.

Is there a way for me to retrieve the url in the browser address bar (after clicking on a specific link) ?

Any help, pointers into documentation would be greatly appreciated

Cheers!

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
maximus 69
  • 1,388
  • 4
  • 22
  • 35

4 Answers4

1

There is no way to do this in Sikuli. I could recommend you use Selenium. It is the best framework for web testing.

Bookeater
  • 474
  • 1
  • 7
  • 12
0

I'd do this with keystrokes. Select all, copy-paste using the clipboard.

click("url.png" )    # select the url location; may be a bit iffy/browser dependent
type("a", KEY_CTRL)  # select all
type("c", KEY_CTRL)  # copy to clipboard
click("target.png" ) # go to your target
type("v", KEY_CTRL)  # and paste

Reference:
http://doc.sikuli.org/keys.html

Bookeater
  • 474
  • 1
  • 7
  • 12
  • 1
    Selecting the address bar usually also can be done using Ctrl + L, see http://www.computerhope.com/tips/tip18.htm – Bookeater Nov 11 '16 at 23:23
0

Simple solution

click(your link);sleep(2) # or wait for loading to finish via an exists()
type("l",Key.CTRL) # hotkey for address bar selection on FF and GC
type("c",Key.CTRL) #copies 
0

You could use the command : type("c", key modifier.CTRL) and after the command: App.get Clipboard(). The commando App.getClipboard get the text of your clipboard and you could save this text one object or variable for use later. (Sorry my english kkk)