本文整理汇总了C++中InternetExplorerDriver::selectElementByClassName方法的典型用法代码示例。如果您正苦于以下问题:C++ InternetExplorerDriver::selectElementByClassName方法的具体用法?C++ InternetExplorerDriver::selectElementByClassName怎么用?C++ InternetExplorerDriver::selectElementByClassName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InternetExplorerDriver
的用法示例。
在下文中一共展示了InternetExplorerDriver::selectElementByClassName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wdFindElementByClassName
int wdFindElementByClassName(WebDriver* driver, WebElement* element, const wchar_t* className, WebElement** result)
{
if (!driver || !driver->ie) { return ENOSUCHDRIVER; }
CComPtr<IHTMLDOMNode> res;
InternetExplorerDriver* ie = driver->ie;
CComPtr<IHTMLElement> elem;
if (element && element->element) {
elem = element->element->getWrappedElement();
}
try {
ElementWrapper* wrapper;
int res = ie->selectElementByClassName(elem, className, &wrapper);
if (res != SUCCESS) {
return res;
}
WebElement* toReturn = new WebElement();
toReturn->element = wrapper;
*result = toReturn;
return SUCCESS;
} END_TRY;
}
示例2: wdFindElementByClassName
int wdFindElementByClassName(WebDriver* driver, WebElement* element, const wchar_t* className, WebElement** result)
{
*result = NULL;
if (!driver || !driver->ie) { return ENOSUCHDRIVER; }
InternetExplorerDriver* ie = driver->ie;
CComPtr<IHTMLElement> elem;
if (element && element->element) {
elem = element->element->getWrappedElement();
}
try {
clock_t end = endAt(driver);
int res = ENOSUCHELEMENT;
do {
ElementWrapper* wrapper;
int res = ie->selectElementByClassName(elem, className, &wrapper);
if (res != SUCCESS) {
continue;
}
WebElement* toReturn = new WebElement();
toReturn->element = wrapper;
*result = toReturn;
return SUCCESS;
} while (clock() < end);
return res;
} END_TRY;
}