seleniumbasic with ahk screenshot

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
adrian_9832
Posts: 26
Joined: 23 Dec 2018, 00:40

seleniumbasic with ahk screenshot

27 Oct 2019, 09:01

my script:

driver := ComObjCreate("Selenium.FirefoxDriver")
driver.Get("https www.google.com.hk /") Broken Link for safety

i:= 1

pic := driver.TakeScreenshot(800)

pic.SaveAs(".\%i%.jpg")

can anyone help me how to printscreen pictrue with var name??? like 1.jpg
User avatar
Hellbent
Posts: 2114
Joined: 23 Sep 2017, 13:34

Re: seleniumbasic with ahk screenshot

27 Oct 2019, 09:39

Assuming that you have everything else correct.

Code: Select all


pic.SaveAs(".\" i ".jpg")
guest3456
Posts: 3469
Joined: 09 Oct 2013, 10:31

Re: seleniumbasic with ahk screenshot

27 Oct 2019, 11:31

for reference, Hellbent is using "auto concatenation" which is just putting a space between the strings and variable names. to be more explicit, you could use the . concatenation operator to make it more clear.

all of these are equivalent:

Code: Select all

string := ".\" i ".jpg"
string2 := ".\" . i . ".jpg"
string3 = .\%i%.jpg
gets kind of hard to see with all the dots in your string

Code: Select all

string := "Hello " name " how are you doing?"
string2 := "Hello " . name . " how are you doing?"
string3 = Hello %name% how are you doing?
see here:
https://www.autohotkey.com/docs/Variables.htm

AHKv2 was going to allow %% derefs within quoted strings, which would have allowed the code in the first post, but it was removed unfortunately.

feiy
Posts: 5
Joined: 16 Apr 2020, 01:39

Re: seleniumbasic with ahk screenshot

06 Jun 2020, 02:42

Hi, I'm wondering which version of browser you're using with Firefoxdriver. My code "driver.Get" can't jump to the page.
adrian_9832
Posts: 26
Joined: 23 Dec 2018, 00:40

Re: seleniumbasic with ahk screenshot

16 Jun 2020, 23:57

i not sure but maybe is firefox38

as

https florentbr.github.io /SeleniumBasic/ Broken Link for safety

Tested environments
Windows 8.1 / Excel 2010 32-bit / Firefox 39 / Selenium IDE 2.9.0
Windows 7 / Excel 2010 32-bit / Firefox 39 / Selenium IDE 2.9.0
Windows XP / Excel 2003 / Firefox 39 / Selenium IDE 2.9.0

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: apeironn, peter_ahk and 326 guests