XLT Multi-Browser-Suite


#1

Hello XLT-Community,
I have several questions about configuration of my XLT-Multi-Browser Framework.

  1. I want to use Firefox driver / gecko with specific network configuration, like:
    FirefoxProfile profile = new FirefoxProfile();
    DesiredCapabilities capabilities=DesiredCapabilities.firefox();
    profile.setPreference(“network.proxy.type”, 4);
    capabilities.setCapability(FirefoxDriver.PROFILE, profile);
    capabilities.setCapability(“marionette”, true);
    return new FirefoxDriver(capabilities);
    Is this possible?
  2. If I using Chrome, my commands are exuting too fast, I dont want to use too much pause commands because it works with this commands, can you help me with configuration?
  3. If I use the select Command with a box without default value I can not select the value. Do you know why?
    Thank you very much
    Dimi

#2

Hi Dimi,

I try to answer your questions. Correct me if I should not have understood you correctly.

At this time there is no support for browser specific network/proxy configuration. Also the marionette capability is not covered by Multi-Browser-Suite. Anyway you can try to advance the code with your own that fits your needs.
You could change the code in the createWebdriver function of class AnnotationRunnerHelper. Your modifications would look like this but it would affect all Firefox configurations.

else if (firefoxBrowsers.contains(browserName))
{
FirefoxProfile profile = new FirefoxProfile();
profile.setPreference(“network.proxy.type”, 4);
capabilities.setCapability(FirefoxDriver.PROFILE, profile);
capabilities.setCapability(“marionette”, true);

return new FirefoxDriver(capabilities);
}

I guess that you receive errors during lookup page elements. In that case you can use the implicite wait property. With that property you tell the WebDriver to wait up to x milli seconds to find the element before it will fail.
Another option would be the usage of the commandRetries property.

###The WebDriver’s implicit wait timeout [ms] used when finding elements. Defaults to 1000 ms.
com.xceptance.xlt.scripting.defaultImplicitWaitTimeout = 1000

How often to retry a command in case the target element was reported as stale. Defaults to 1.

com.xceptance.xlt.scripting.commandRetries = 1

Maybe you should also have a look on the waiting commands. These are a straight forward to use and you do not need separate pause commands.
https://lab.xceptance.de/releases/xlt/latest/user-manual/10-command-reference.html#toc-waiting-commands

I would need more information to help you in that case. I can not reproduce that behaviour.

Best regads,

Marcus


#3

Hello Marcus,

thank you for the fast answer. My problem is the waiting time. I recorded my tests with XLT, with many waitForElementPresent Commands and it runs good, but with the automation tool it is ti fast and crashing. I tried the solution with implicit wait, but it seem not to work. I changed my default.properties, but it looks like dissabled (gray).
I am using AbstractAnnotatedScriptTestCase because I need to Login before starting the test.

Best regards,

Dimi


#4

Hi Dimi,

could you please provide some more information of the crash? A screenshot or stacktrace would be great. I need to understand your usecase in order to help you. I tried to create a testcase based on the information you provided but I was not able to reproduce this issue.

Best regards,

Marcus


#5

Thank you for your replies it helps me so much.
I have a new question: I can automate my Testcases in the XLT MUlti-Browser-Suite but if I using XLT Script Developer, it is not working every time. Do you now why?
Its is always the click button after a refresh on the website.


#6

Hi Dimi,

This sounds like a timing issue, although you did not say what exactly stops working.

Easiest solution would be to wait for the page load to be complete and continue after that.
For example, you might try it with waitForEval(document.readyState === 'complete').

Thx,
Hartmut


#7

Hey Hartmut,

the problem is a button to the next page of the software that I test. It is a workflow of different pages and only on this page XLT Script Delevoper fail to click the “next” button. Automated tests with webdriver work very fast and without problems. I use gecko 0.18 and ff 54.0.1
I think it is because of ff54 but maybe you have other solution?

Thanks
Dimi


#8

I tried javascript and it worked, but why?
Solution :
command name=“storeEval” target=“document.getElementById(‘weiter’).click()” value=“weiter”


#9

Hi Dimi,

Without your code and access to the site under test, it’s really hard to say what is the issue here.

But the following explanation might help:
Clicking on element in Script Developer is done by dispatching a series of events (mousedown, mouseup, click) at the target element. In case the target element is a traditional clickable element (such as an anchor or form controls like a button) the default action is carried out. Otherwise, the dispatched events must be processed accordingly by attached event handlers.

So, my first question would be as follows: Is the element you’re trying to click on a typical <button /> element, or any other type of traditional clickable element? If not, you would need to adjust your locator to match that element that “knows” how to handle a click.

Thanks,
Hartmut


#10

input name=“weiter” value=“Weiter” id=“weiter” tabindex=“2015” class=“button” type=“submit”

sorry I can not give you an acces to the website because it is not allowed to me as tester. But I can eplain the structure. It is a website with a select field, text field and a button.
After the selection it refresh the website and after the refresh I can fill the text field. If I clickAndWait the button described above it isa no reacting. The intetersting point this button is clickable on other workflow steps but not on this. On this I can only click on it with the javascript code.


#11

Does it work when you manually navigate to the page and execute the click command by pressing X?


#12

it works if I execute with the mouseclick on myself. If I click with execute “X” -> XLT Scripte Developer click the button but my website do not react. (I can see the refressh on Firefox but nothing happen)


#13

Could you please explain what you mean with “I can see the refressh on Firefox but nothing happen”?
Are you seeing the loading icon in your browser tab when you replay with X? If so, then the click is working.


#14

Yes that’s exactly my problem =)


#15

Could you please double-check that there is exactly one element found for the locator you use in the clickAndWait command? If not then Script Developer might dispatch the events on the wrong element.

Otherwise, I have no idea what is causing your issue.


#16

Hmm I think its my software problem. But thank you very much for help. I hope the end version release of geckodriver will solve it.
Do you have something like a FireEvent in XLT ?


#17

This is not related to GeckoDriver as you said that the click is not working in Script Developer in contrast to WebDriver.

And, no. If you did not find such a command like ‘FireEvent’ in the command drop-down in Script Developer then you can be sure that such a command does not exist.
The reason for this is quite simple: Websites should be tested the same way as they are used and a typical user does not fire events, he interacts with the site and as reaction these interactions, events might be or might not be fired.

Thanks,
Hartmut


closed #18

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.