Skip to content
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

Simulate clicks? #44

Open
TimeAshore opened this issue Jul 23, 2019 · 7 comments
Open

Simulate clicks? #44

TimeAshore opened this issue Jul 23, 2019 · 7 comments

Comments

@TimeAshore
Copy link

When sending POST requests, you need to carry parameters.
So, Can you skip this part and directly simulate clicks?

Thanks, Sincerely.

@TimeAshore
Copy link
Author

I got it!
But.. how to enter text in the page input box, which part of the Chrome DevTools Protocol?

@Tindome
Copy link

Tindome commented Jan 20, 2020

i don't know if it could help you but i proceed like that for an identification form by example
my example is a bit complex because the fields have events on them so i need to really dispatch mouseevent
select with css the node of the field
find the localisation x,y of the field (because click need them)
use click method of devtools protocol on it (2 * dispatchMouseEvent one for "mousePressed" and one for "mouseReleased")
wait 0,1 ssec
check if the node is of type input, if so use select() method to reset it
use sendText method of node element

@TimeAshore
Copy link
Author

i don't know if it could help you but i proceed like that for an identification form by example
my example is a bit complex because the fields have events on them so i need to really dispatch mouseevent
select with css the node of the field
find the localisation x,y of the field (because click need them)
use click method of devtools protocol on it (2 * dispatchMouseEvent one for "mousePressed" and one for "mouseReleased")
wait 0,1 ssec
check if the node is of type input, if so use select() method to reset it
use sendText method of node element

thanks!

@Tindome
Copy link

Tindome commented May 8, 2020

i have realize a wrapper for pychrome which help use it by keeping verb like those used in selenium if anybody interested

@TimeAshore
Copy link
Author

which

@Tindome
Copy link

Tindome commented May 26, 2020

i will add it to my repo as soon as i could (really busy at works) it was an early preview (working for my need but could have some bugs)

@woshichuanqilz
Copy link

I got it!
But.. how to enter text in the page input box, which part of the Chrome DevTools Protocol?

Can you give me a example about click an element?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants