This is a migrated thread and some comments may be shown as answers.

Problem with InnerMarkup, OuterMarkup and StartTagContent in Chrome, Firefox browsers

2 Answers 104 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Test
Top achievements
Rank 1
Test asked on 07 Jun 2013, 08:00 PM
Hello,
I have the element with such expression:
"tagname=div,class=select-normal,OuterMarkup=~id=mailprefs_default_compose_mode_labellink"
Element is determined correctly in IE browsers, but i have issues in Chrome and Firefox. I've got such error while executing scripts in followed browsers:
Unable to locate element. Details: Attempting to find [Html] element using 
Find logic 
 (Html): [class 'Exact' select-normal] AND [OuterMarkup 'Contains' id=mailprefs_default_compose_mode_labellink] AND [tagname 'Exact' div]

Inside Frame:[Frame:id=main_iframe,name=Frame_0,src=https://domain.com/ajax_prefs/main.php,UseQuery:True]
Unable to locate element. Search failed!

This issue is replicated for Firefox and Chrome browsers, and after this error i can't complete execution of test suite successfully. 
Note: I don't need to use tags such as title or name, because application is multi-language. Please look at this sample of code: 
<div id="mailprefsBody" style="height: 473px;">
<div class="pref-padwr">
<table cellspacing="0" cellpadding="0" role="grid">
<tbody>
<tr class="PrefText">
<td>
                    <select title="Default compose mode" alt="Default compose mode" tabindex="8160" id="mailprefs_default_compose_mode" name="default_compose_mode" style="display: none;">
                        <option value="Text">Text</option>
                        <option value="HTML">HTML</option>
                    </select><div class="select-normal" alt="Default compose mode" title="Default compose mode"><div class="select-inp"><div class="select-t">Text</div><a class="select-arr" id="mailprefs_default_compose_mode_labellink" tabindex="8160"></a></div></div>
                </td>
</tr>
</tbody>
</table>
</div>
</div>

2 Answers, 1 is accepted

Sort by
0
Accepted
Mario
Telerik team
answered on 12 Jun 2013, 05:56 PM
Hi,

Thank you for contacting Telerik Support.

I first notice that your partial match for OuterMarkup does not contain the quotes as it is displayed in the code you pasted, I would have expected your working expression to be:

OuterMarkup=~id="mailprefs_default_compose_mode_labellink"

In general, using InnerMarkup, OuterMarkup and StartTagContent in find logic can cause this type of problem. If there is any minor discrepancy between how an element is rendered between browsers, it could cause the find logic to fail as you've seen.

I suggest using a set of developer tools for each browser (FF and Chrome) to carefully compare and look for any obvious differences. If there are any, hopefully it will be possible to alter your logic to cover these differences across all browsers using one element. An alternative would be to use browser specific steps in your test when needed, this way only the appropriate step (which acts on an element with slightly different logic to fit the corresponding browser) would execute depending of course on the browser being used (see 'Runs Against' step property).

Let me know whether my suggestion helps.

Regards,
Mario
Telerik
Free summer webinars on advanced web automation tactics hosted by Jim Holmes & Adam Goucher.
Reserve your seat today!
0
Test
Top achievements
Rank 1
answered on 12 Jun 2013, 06:54 PM
Hello Mario,
Thanks for suggestions. You're right. Main problem was differences rendering code and elements in browsers. Firefox and Chrome are based on same driver(Webkit), and they have similar standards for rendering, as opposed to IE.
Tags
General Discussions
Asked by
Test
Top achievements
Rank 1
Answers by
Mario
Telerik team
Test
Top achievements
Rank 1
Share this question
or