修复无父层窗体时无法切到顶层的问题
This commit is contained in:
parent
c76487a31b
commit
5eb369d13a
|
@ -12,11 +12,10 @@ import org.openqa.selenium.By;
|
||||||
import org.openqa.selenium.TimeoutException;
|
import org.openqa.selenium.TimeoutException;
|
||||||
import org.openqa.selenium.WebDriver;
|
import org.openqa.selenium.WebDriver;
|
||||||
|
|
||||||
import pres.auxiliary.selenium.event.NoSuchWindownException;
|
|
||||||
import pres.auxiliary.selenium.xml.ByType;
|
|
||||||
import pres.auxiliary.selenium.xml.ReadXml;
|
|
||||||
import pres.auxiliary.work.selenium.brower.AbstractBrower;
|
import pres.auxiliary.work.selenium.brower.AbstractBrower;
|
||||||
import pres.auxiliary.work.selenium.brower.Page;
|
import pres.auxiliary.work.selenium.brower.Page;
|
||||||
|
import pres.auxiliary.work.selenium.xml.ByType;
|
||||||
|
import pres.auxiliary.work.selenium.xml.ReadXml;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p><b>文件名:</b>AbstractElement.java</p>
|
* <p><b>文件名:</b>AbstractElement.java</p>
|
||||||
|
@ -259,6 +258,12 @@ public abstract class AbstractBy {
|
||||||
* @param elementInformationList 存储窗体的名称或xpath与css定位方式的List集合
|
* @param elementInformationList 存储窗体的名称或xpath与css定位方式的List集合
|
||||||
*/
|
*/
|
||||||
void switchFrame(List<String> frameNameList) {
|
void switchFrame(List<String> frameNameList) {
|
||||||
|
//若传参为空,则切回到顶层
|
||||||
|
if (frameNameList.isEmpty()) {
|
||||||
|
switchRootFrame();
|
||||||
|
}
|
||||||
|
|
||||||
|
//若不为空,则列表进行切换
|
||||||
frameNameList.forEach(frameName -> {
|
frameNameList.forEach(frameName -> {
|
||||||
//判断name指向的窗体是否在iframeNameList中,若存在,则向上切换父层,直到切换到name指向的窗体;若不存在,则直接切换,并添加窗体名称
|
//判断name指向的窗体是否在iframeNameList中,若存在,则向上切换父层,直到切换到name指向的窗体;若不存在,则直接切换,并添加窗体名称
|
||||||
if (iframeNameList.contains(frameName)) {
|
if (iframeNameList.contains(frameName)) {
|
||||||
|
|
Loading…
Reference in New Issue