Testcafe Browserstack IE11- Clicking on button doesn't work - testing

Error: Button click doesn't perform action as expected, page is being Idle
Current behavior: It's clicking on a button but it's not performing any action
Expected behavior: Manually it works! expected the button click should move to the next page
Tried using Press key, hover, Client function for Selector
Unfortunately I couldn't provide more details of the application but I will appreciate providing workarounds

Seems like it was fixed in TestCafe v1.9.1.

Related

How can I fix a button that is clicked but does not perform any actions?

So I'm currently working on a new project and I need to write some automated tests.
I came across a problem and I don't know how to fix it. If the button of my web page is clicked running selenium it doesn't perform any actions, but if I open the web page manualy and click on the button, everything works fine.
NOTE: I'm completely sure that the xpath is correct and the button is being clicked...
This is what happens running with selenium:
And this is what happens openning the web page manually and clicking on the button:

Why is the element being tested (via protractor) clicked, but nothing happens?

I am using protractor v4.0.9 and node v6.8.1 (although I have also tested this issue on 4.6). I have a test that runs through a series of button clicks to get to a form. The code looks something like this:
browser.get('http://someurl');
// App select button
element(by.id('btn-select-app')).click();
// portal select
element(by.id('row-test-portal')).click();
// provisioning form button
element(by.id('btn-provisioning-form')).click();
This is then followed by a function that iterates through the form and fills it out. If I run the test from start to finish (including the function that fills out the form) it will fail when it tries to start filling out the form because it is on the wrong page - that is, even though the terminal is telling me it executed the click on the provisioning button, the form did not load.
If I shorten the test and run it only with the commands you see in the block above, it passes.
When I run it in debug mode I can execute the "element(by.id('btn-provisioning-form')).click();", but it doesn't appear to actually do anything - it will tell me it executed the the click, but the form does not appear on the page - I am still on the previous page. Note that the above test contains another button click prior to the click on the provisioning form button and that appears to work normally.
I have gone so far as to use different locators for the button including xpath and css but the nothing will get me to the provisioning form.
Button code
<div class="col-md-1">
<button id="btn-provisioning-form" ng-show="foo()"
class="btn btn-success glyphicon etc" ng-click="blah()"
aria-label="Provision" popover="Provision" popover-trigger="mouseenter">+</button>
</div>
Some other notes - I have managed to replicate the test using Selenium IDE and when I run that test from the Selenium IDE UI, it is able to click the button and get to the form. It looks like this issue is just being seen when I use protractor.
TL;DR : Protractor is telling me it clicked the button, but the button click isn't causing any change to the page. When I manually click the button outside of protractor, it works just fine. Why is this happening?
Instead of normal protractor click , try clicking through JavaScript code.

Selenium stops running after click() function runs

So I am writing a class in eclipse using selenium and autoitx4java libraries, now I have been having an issue that I believe is selenium specific (meaning having nothing to do with autoIt).
Basically when I arrive at the splash page for the website I am attempting to test, the first thing I do is find the element for the login page via XPath, and click on it using the click() method. This is supposed to open up a certificate window.
Once the click() method runs a certificate window comes up, however, for some reason the selenium test does not keep running lines of code. Instead it pauses at the line the click function was executed. The code looks a bit like this:
WebElement login = driver.findElement(By.xpath("example_xpath"));
login.click();
// login.sendKeys(Keys.ENTER);
System.out.println("login clicked");
Class.selectCert();
(Where "Class" is just a class created for this specific test.)
So when the code is run in Selenium, the line "login clicked" is never printed out. As you can see, the alternate sendKeys(Keys.ENTER) function has been tried. When I used this function, literally nothing happened, and the code continued as if that line of code did not exist.
Note: When I highlight the element and manually press ENTER, the certificate window actually pops up.
This is where things get weird. When I remove the line for the click function, and replace it with a pause() function which gives me ample time to click on the element manually. The code runs perfectly fine, the "login clicked" is printed out, and the certificate window is handled by the autoIt code I have in the selectCert() function.
I have tried clicking on different elements on the screen, and so far this bug only occurs when clicking on elements that have an xpath with /img at the end of it. Not sure if that helps at all... Any help would be appreciated!

selenium webdriver to identify the google play store popup

I was trying to identify the element in the google play store using firebug the element was identified by the firebug successfully but when I execute the selenium code it throws Invalid selector exception.
1. Login to playstore with the gmail account.
2. In the search box, type whatsapp and click on install button
3. It opens popup, I wanted to click on dropdown values and then click on install or just click on cancel button
For the cancel button, I wrote the following code:
driver.findElement(By.xpath(".//*[#id='purchase-cancel-button']")).click();
which is not working.
Try with below cssSelectors
By.cssSelector("button[id='purchase-cancel-button']");
Or
By.cssSelector("div.modal-dialog button[id='purchase-cancel-button']");
This item is currently invisible so you have to make a delay for a couple of seconds, f.e.
`
(driver.find_element_by_xpath(
'//*[#id="body-content"]/div/div/div[1]/div[1]/div/div[1]/div/div[3]/div/div[1]/span/span/button')).click()
time.sleep(4)
(driver.find_element_by_xpath('//*[#id="purchase-ok-button"]')).click()
`

PhantomJS click action not working on span when trying to login to Office365

I am trying to automate office365 operation, and try to login using phantomjs. I use sendEvent to send click to the span UI item (which happens to be the fake submit button). I use render to capture the screen-shot after sending the click event, and it seems the button is selected (greyed out) but never receives the click event.
I have a similar problem when trying to "click" this button with Selenium.
Has anyone ever successfully automated the office365 login? I guess this has something to do with the way the web page is structured. (There is another layer of javascript that receives the click event then redirect the user to the app page).
Is there any other tool that is better fit for such task? (I tried twill as well, and have no luck.)
I have a Selenium project that logs into Office365, but I've also had a lot of issues with being able to do it consistently. The CSS selector I'm using for the Sign In button is #cred_sign_in_button. If you look at the source, that is a span that has the click handler.
<span id="cred_sign_in_button" tabindex="11" **onclick="Post.SubmitCreds()**;return false;" class="button normaltext cred_sign_in_button refresh_domain_state" role="button" style="opacity: 1;">Sign in</span>
I've found that clicking on the button once doesn't work most of the time. I assume that's due to the animation happens when you hover over the button. What finally ended up working for me was to click, wait 250ms and click again.