I recently faced an issue with Convertigo Studio in a particular web page.
The page have an HTML tag of type
<FOO:BAR>...</FOO:BAR>
Using Connector's view to select an element inside this tag to generate the according xpath ends in an alert error: "Xpath not valid".
The xpath parser is considering the first part of the tag as a namespace and can not resolve it.
To generate an xpath of an element inside that tag, you have to select a parent element and browse down DOM with the DOM's tree view on the left of connector's view.
Some statements (Mouse action, HTML set selected,...) generates an absolute Xpath to execute action on the element. In this case, it also generates an error.
Here are some workarounds:
_ When applicable, you can replace the failing statement by a 'Navigation Bar' statement or an 'Inject JS in browser'.
In my personal case, I replaced the Mouse action (click on a link) by a 'Navigation bar' (goTo action on a full url path) statement.
The 'HTML set selected' has been replaced by an 'Inject JS in browser' statement with this kind of code:
| Code: |
// Get the <select> by its name and not id because
// the page has several <select> elements with the same id:
var x=document.getElementsByName("selectName")[0];
// For each <option> compare its value with 'val' variable
// If found select the proper index and break loop:
for(var i=0;i<x.length;i++){
if(x.item(i).value==val){
x.selectedIndex=i;
break;
}
}
// submitting the form:
document.getElementsByName("form")[0].submit();
|
Don't forget to map Convertigo's variables to the internal statement's variables ('Inject JS in browser' 'Variables' property)