selenium bomb box element positioning - Freeze interface

Some sites above elements, we mouse on top, it will pop up a number of dynamic content.

For example, the upper right corner Baidu home page, there is more product options, as shown below:

 

 

 

 

 

If we put the mouse on top, it will pop up the following Baidu marketing, music, pictures and other icons.

If we use selenium automated click the Music icon, you need to see this element F12 features.

But when our mouse away from the music icon, on the whole this column disappeared, would not be able to see its corresponding HTML.

How to do?

Figure may be as follows:

 

 

 

Do the following js code developer toolbar inside the console:

setTimeout(function(){debugger}, 5000)

This code What does it mean?

It represents 5000 ms, the command execution debugger

Execute the command browser will enter debug state. debug state has a feature, the interface is frozen, no matter how we click interface will not trigger the event.

So, we can enter the above code and press Enter after the execution, immediately mouse over the upper right corner at more products.

At this time, it will pop up the following Baidu marketing, music, pictures and other icons.

Then, we carefully wait 5 seconds later, the debugger interface will execute the command as being frozen.

Then, we can click the arrow to view the developer tool bar, go click on Baidu marketing icon, view its properties up.

Guess you like

Origin www.cnblogs.com/Ethan-Sun/p/11946560.html