Or use JS to move
The first thing to do is to locate this element
tend to use JS to locate elements, enter the following script, press ENTER, you can see the corresponding div block on the Debug page
$ ("div.table-responsive")
Scrolling method using ScrollLeft ()
$ ("div.table-responsive"). ScrollLeft (1000)
Apply to Java Selenium
To avoid entering numbers, you can write this
((Javascriptexecutor) driver). Executescript ("$ (\" Div.table-responsive\ "). ScrollLeft (Document.body.scrollWidth)" );
Second, the Action popup dialog box
Regular front-end dialogs are used in the form of div blocks
such as positioning <div class= "Mb_btnbox". ><span><span></div> the second span inside
$ ("Div.mb_btnbox"). Find ("Span:eq (1)")
((Javascriptexecutor) driver). Executescript ("$ (\" div.mb_btnbox\ "). Find (\" Span:eq (1) \ "). Click ()");
To skillfully use the functions of js,jquery, you will find that when using commonly used selenium functions are not able to locate elements, such as the element ID is similar to the change, can be based on the hierarchy of the structure of the movement of XPath operations
However, such as pop-up dialog box, I prefer to choose JS to operate the "OK", "Cancel" this, convenient and fast is not prone to error, but also improve the familiarity of js,jquery
Selenium move div inside the scroll bar, Action popup dialog box