Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 31 2019 19:00
    tfaron commented #5133
  • Jan 31 2019 07:28
    cnishina closed #5135
  • Jan 31 2019 07:28
    cnishina commented #5135
  • Jan 30 2019 16:23
    ThabisoGithub closed #5136
  • Jan 30 2019 16:23
    ThabisoGithub edited #5136
  • Jan 30 2019 16:23
    ThabisoGithub edited #5136
  • Jan 30 2019 16:21
    ThabisoGithub opened #5136
  • Jan 30 2019 16:18
    IgorSasovets commented #4177
  • Jan 30 2019 15:05
    andrewchan-clover commented #4177
  • Jan 30 2019 13:43
    IgorSasovets commented #5135
  • Jan 30 2019 12:37
    EnzDev edited #5125
  • Jan 30 2019 11:47
    akshaymondal opened #5135
  • Jan 29 2019 14:33
    uinest commented #4822
  • Jan 28 2019 21:38
    cnishina commented #5132
  • Jan 28 2019 21:37
    cnishina commented #5134
  • Jan 28 2019 21:37
    cnishina closed #5134
  • Jan 28 2019 21:36

    cnishina on selenium4

    chore(release): bumpb version t… (compare)

  • Jan 28 2019 11:30
    think4ideas opened #5134
  • Jan 28 2019 11:01
    toniedzwiedz commented #2735
  • Jan 28 2019 09:42
    azorrozua commented #4786
Shalu
@shalu0628

@StanislavKharchenko -- this is my code -- "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
import { browser, element, by, By, $, $$, ExpectedConditions, ElementFinder, ProtractorBrowser } from 'protractor'
import { Workbook } from 'exceljs'
var protractor = require("protractor");

describe('Read from excel', async function () {

it('open and read excel data',async function () {


    var wb = new Workbook();
    wb.xlsx.readFile("C:\\Users\\Lenovo\\test-ui\\outputjs\\exceldata\\TestData.xlsx").then(async function () {

        var sheet = wb.getWorksheet("Protractor_Test_Data");
        var numberofRows = sheet.rowCount;
        var numberofCols = sheet.columnCount;

        const addresselem = sheet.getRow(2).getCell(1).toString();
        const addressdata = sheet.getRow(2).getCell(2).toString();
        const getquotebtn = sheet.getRow(2).getCell(3).toString();
        console.log(addresselem);
        console.log(addressdata);
        console.log(getquotebtn);


        browser.get("http://x.xxx.xxx.xx/home/#/Homepage");
        await browser.sleep(10000)

        browser.element(by.xpath(addresselem)).sendKeys(addressdata); 
        await browser.sleep(5000);
        await browser.element(by.className(getquotebtn)).click();
        await browser.sleep(5000);      

    })
})

})

I have used async functions and await in browser.sleep
the broser gets closed in 0.109 seconds or so
please help
it successfully fetches code from excel and prints on the console.. but after that the URL is launched and gets closed too quickly.. and I cannot see if the data is being sent to the textbox or not
StanislavKharchenko
@StanislavKharchenko
use "await" keyword before any action with browser. So, in your example, you need to set "await" before: browser.get, browser.element
Shalu
@shalu0628
@StanislavKharchenko - thank you so much for responding! I tried, adding await before browser.get actions but the same thing happens.. I cannot see the browser - and data being entered in the textbox at all.. kindly advice..
the above is in protractor jtypescript asmine framework
StanislavKharchenko
@StanislavKharchenko
@shalu0628 Did you tried to run test in debug mode, set breakpoint in browser get and observe what happened?
Shalu
@shalu0628
okay, I will try @StanislavKharchenko
Jan Molak
@jan-molak

Hey folks, I've just published a new chapter of "Thinking in Serenity/JS", where you'll learn how to build a full-stack acceptance testing framework from scratch with Serenity/JS

Check it out and let me know what you think!

"Thinking in Serenity/JS"

Shalu
@shalu0628
browser.executeScript('window.scrollTo(0,2000000);').then(function () {
chkboxprevdecpg.click();
}) ----> Hi all, am trying to scroll down using this code and the scroll is not working.. can someone please guide?
StanislavKharchenko
@StanislavKharchenko
@shalu0628 await browser.executeScript('arguments[0].scrollIntoView()', element.getWebElement()); where element - is Protractor ElementFinder. So you will be navigated into element located at page
Shalu
@shalu0628
Shalu
@shalu0628
Hi All, I am trying to upload a file from my system -- here is the code that I referred from StackOverflow --- but it doesn't send the path in the FilePath -- can someone please help? --- var uploadInput = element(By.css("input[type=file]"));
uploadInput.sendKeys("C:\UploadFileTest-UI\sample.txt");
The window is opened.. but the sendKeys is not getting executed.. can someone please help?
StanislavKharchenko
@StanislavKharchenko
@shalu0628 you need just to interact with locator available in dom tree. What do you mean "the window is opened" ?
Shalu
@shalu0628
@StanislavKharchenko - the file window to choose the file is opened.. but it doesn't enter the path .. actually, I cannot get the locator as its outside of my browser..
StanislavKharchenko
@StanislavKharchenko
@shalu0628 You don't need to open "upload dialog". This dialog is a part of windows application, and not controlled by browser. You need to just sendKeys a path to file into input element in the dom tree.
Example:
import remote = require('selenium-webdriver/remote');
browser.driver.setFileDetector(new remote.FileDetector());
await browser.element(by.css('input[type="file"]')).sendKeys(filePath.join('\n'));
Shalu
@shalu0628
okay, thank you @StanislavKharchenko
Shalu
@shalu0628
Hi All, the front developers are using a custom created tag by some means.. how do I get the handle to such a tag in protractor?
spmiller
@spmiller
@shalu0628 we use custom tags with Angular all the time and it protractor handles it fine?
Shalu
@shalu0628
image.png
@spmiller -- can you please help me -- as I am not able to get the handle to this tag as in the HTML code below ---
am trying to get all the elements within the tag 'insurance-select' - please let me know how I should proceed to do that..
2 replies
Craig Nishina
@cnishina
Oh hey, just checking in with my update! My focus keeps shifting. I am working on a high priority widgety tool...it has now taken tippy top-top priority. The good news is that I got some approvals to start in September working on "stuff" and I might have another engineer working on "stuff" too. I have no idea what state the repo is in and I am kind of afraid of looking.
Aasim Anwar
@aasimali
@cnishina - Do we have any news about Protractor? Will it end by 2022
StanislavKharchenko
@StanislavKharchenko
@cnishina I could say, that no updates in Protractor repo more than year. I think community urgently wants to migrate to w3c compliant Protractor, especially Selenium team is going to cut official non-beta release in the late Q3. Also, still no updates from Angular team regarding continuation of Protractor after 2022.
Craig Nishina
@cnishina
@aasimali I do not have news about Protractor. I wish I had more information about that specifically. @StanislavKharchenko thanks for the update.
Shalu
@shalu0628
How do we get the handle to a value which is visible in ui but not when I try to inspect ? Any help anyone?
Aasim Anwar
@aasimali
Oh, thanks for the reply @cnishina :)
StanislavKharchenko
@StanislavKharchenko
@shalu0628 const elValue = await yourElementFinder.getAttribute('innerText');
Shalu
@shalu0628
Thank you very much @StanislavKharchenko
Shalu
@shalu0628
Why do I receive this error sometimes and not always -- Error: function timed out, ensure the promise resolves within 5000
milliseconds
at Timeout._onTimeout (C:\LenderPortal-UI\node_modules\cucumber\lib\user_code_runner.js:81:20)
at listOnTimeout (internal/timers.js:554:17)
at processTimers (internal/timers.js:497:7)
Its just loading the homepage and this error is thrown.. I have used sleep only in my hooks.ts file -- BeforAll only...
And again the same thing runs perfectly fine the second time.. Can someone please help me understand the reason for this issue and how to fix the same?
StanislavKharchenko
@StanislavKharchenko
@shalu0628 Perhaps you need to increase timeout in Protractor config, allScriptsTimeout
Shalu
@shalu0628

BeforeAll({timeout: 100 * 1000}, async () => {
await browser.get(config.baseUrl);
});

Before({timeout: 100 * 3000},async () => {
await browser.manage().deleteAllCookies();
});

this is the only sleep in my entire test script
do I need to increase the time out here? @StanislavKharchenko
Aasim Anwar
@aasimali
@shalu0628 which combination are you using along with Protractor? Cucumber?
Aasim Anwar
@aasimali
If cucumber, then From cucumber, import setDefaultTimeOut method and then override the same and see if it helps...
Shalu
@shalu0628
@aasimali yes, protractor with cucumber.. okay.. Thank you very much!
kappakp
@kdp88
9 replies
Jan Molak
@jan-molak
@shalu0628 - check out my answer on StackOverflow - https://stackoverflow.com/questions/41806327/increase-timeout-when-running-against-remote-grid where I've described the different timeouts
Shalu
@shalu0628
Thank you @jan-molak
Jan Molak
@jan-molak

Hey folks, I've just released a new version of Serenity/JS and protractor-cucumber-framework to improve the support for Cucumber rerun feature:

Please see the changelog, update to the latest version, and let me know if you spot anything that could be improved.

Tejkumar Kempaiah
@T-e-j-k-u-m-a-r

Hello Folks,

Problem Statement 1:

I have a login page in an angular application where failonstatuscode is 500(Internal Server),
Due to which the login page just loads and enters username, password and click on login is not working or login is not successful.
I know we can handle it by refreshing the browser that instance. How not sure how it can be achieved.

How can we handle it Protractor such as refreshing the screen when encountered ?

Please suggest.