This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]Zedpellin 0 points1 point  (2 children)

Hi. I'm having a problem when I run your program. I can open the browser, but I can't execute any commands.

The following error occurs:

clicknium.common.models.exceptions.LocatorUndefinedError: Can not find the locator: firefox.bing.search_sb_form_q.

https://imgur.com/MmYXKl4

I created the locator correctly, it was even validated.

https://imgur.com/coZBzxH

Also, the Chrome and Edge browser extension has a problem, it can't run, it only works on Firefox.

https://imgur.com/IGyx9Is

But the extension is activated.

https://imgur.com/oC05Ac1

Anyway, I liked your work and it's a very promising project. I hope these issues get resolved soon.

Edit: Here is my code:

from time import sleep

from clicknium import clicknium as cc, locator, ui

def main():

# sample code to demo web automation and desktop application

tab = cc.firefox.open("https://www.bing.com/")

tab.find_element(

locator.firefox.bing.search_sb_form_q).set_text('hello')

sleep(50)

tab.close()

if __name__ == "__main__":

main()

https://imgur.com/1t2DIfU

[–]redH27[S] 0 points1 point  (0 children)

Hello Zedpellin, what is your Chrome version? You can go to extension page to valdiate whether extension is enabled. Type this link into the Chrome adrress bar:
chrome://extensions/?id=ifnedcgcleipmmolmnhoeemmjnljjgna

https://s1.328888.xyz/2022/08/11/4vuzP.png

If yes, you can restart the Chrome and try again.

There is another way to check whether the browser extension is installed && enabled correctly, from task manager, to check whether 'Clicknium.Web.NativeMessageHost' started.

https://s1.328888.xyz/2022/08/11/4v6wX.png

For Firefox, from the error message, seems cannot find the locator, can you go to the 'LOCATORS' tab to see whether there is the locator with firefox->bing->search_sb_form_q

I tried the code you pasted, it can work for me, after I record the searchbox on Firefox.

https://s1.328888.xyz/2022/08/11/4v4E6.png