Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
814 views
in Technique[技术] by (71.8m points)

selenium - Textbox events?

I am using Kantu to automate filling out some forms. There is a textbox that when a persons id number is entered and you click into another box or tab out of the textbox it will load that persons vcard. I can try to expound if you need more clarity.

I don't know much but i'm guessing me clicking into another box is activiating some kind of event to load this vcard. I can't seem to simulate this. Does anyone know of a way to do so?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Welcome to SO. There are different option to get the associated events.

Let's take the stackoverflow search box (the one which is on the top with s-input js-search-field class)

1) Using getEventListeners

Go to chrome console in the dev tools and then use getEventListeners(element).

getEventListeners(document.querySelector('.s-input.js-search-field '))

enter image description here

2) Using Dev Tools Event Listner

Go to chrome dev tools and select the element for which you want to know the events, click on the Event Listeners tab on the right hand side pane. enter image description here

3) Using the firefox event

Goto dev tools in firefox and click on events bubble at the end of html element tag. enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...